This commit is contained in:
Solenopsisbot 2025-06-10 22:03:34 -05:00 committed by GitHub
commit cc0ac7a0c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 1 deletions

View file

@ -29,6 +29,7 @@ const settings = {
"init_message": "Respond with hello world and your name", // sends to all on spawn
"only_chat_with": [], // users that the bots listen to and send general messages to. if empty it will chat publicly
"speak": false, // allows all bots to speak through system text-to-speech. works on windows, mac, on linux you need to `apt install espeak`
"chat_response": true, // enables or disables bots sending their responses to minecraft chat
"language": "en", // translate to/from this language. Supports these language names: https://cloud.google.com/translate/docs/languages
"show_bot_views": false, // show bot's view in browser at localhost:3000, 3001...

View file

@ -392,7 +392,8 @@ export class Agent {
if (settings.speak) {
say(to_translate);
}
this.bot.chat(message);
if (settings.chat_response) {this.bot.chat(message);}
sendResponseToServer(this.name, message);
}
}

View file

@ -71,3 +71,7 @@ export const serverProxy = new AgentServerProxy();
export function sendBotChatToServer(agentName, json) {
serverProxy.getSocket().emit('chat-message', agentName, json);
}
export function sendResponseToServer(agentName, message) {
serverProxy.getSocket().emit('response-message', agentName, message);
}

View file

@ -128,6 +128,9 @@ export function createMindServer(port = 8080) {
console.error('Error: ', error);
}
});
socket.on('response-message', (agentName, message) => {
io.emit('response-message', {agentName, message});
});
});
server.listen(port, 'localhost', () => {