mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
show original chat message
This commit is contained in:
@@ -25,21 +25,6 @@ function createHandlers({ sendSystemMessage }) {
|
|||||||
// where an external API or rover-side feature has a real hard limit.
|
// where an external API or rover-side feature has a real hard limit.
|
||||||
if (hasProfanity(clean)) return cb({ error: 'Message blocked' });
|
if (hasProfanity(clean)) return cb({ error: 'Message blocked' });
|
||||||
|
|
||||||
try {
|
|
||||||
const consumedAsCommand = await runChatTextCommand({ text: clean, socket, sendSystemMessage });
|
|
||||||
if (consumedAsCommand) {
|
|
||||||
cb({ success: true, command: true });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
// Command errors are returned through the existing chat acknowledgement
|
|
||||||
// contract. This keeps command execution server-side and avoids adding a
|
|
||||||
// new client pathway just to display failures.
|
|
||||||
logger.warn('Chat command failed', { socket: socket?.id, error: err.message });
|
|
||||||
cb({ error: err.message || 'Command failed' });
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const roverId = resolveRoverId(socket?.id);
|
const roverId = resolveRoverId(socket?.id);
|
||||||
const ttsOptions = normalizeTtsOptions(tts);
|
const ttsOptions = normalizeTtsOptions(tts);
|
||||||
const message = buildMessage(socket, clean, {
|
const message = buildMessage(socket, clean, {
|
||||||
@@ -64,6 +49,22 @@ function createHandlers({ sendSystemMessage }) {
|
|||||||
broadcastMessage(message);
|
broadcastMessage(message);
|
||||||
maybeSendAccessNotice(message, sendSystemMessage);
|
maybeSendAccessNotice(message, sendSystemMessage);
|
||||||
maybeSpeak(socket, message, ttsOptions);
|
maybeSpeak(socket, message, ttsOptions);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Commands sent from site chat should still be visible as normal chat
|
||||||
|
// messages. Running the command after broadcast preserves the user-visible
|
||||||
|
// transcript while keeping permissions and command execution entirely on
|
||||||
|
// the server.
|
||||||
|
const ranCommand = await runChatTextCommand({ text: clean, socket, sendSystemMessage });
|
||||||
|
cb({ success: true, command: ranCommand });
|
||||||
|
return;
|
||||||
|
} catch (err) {
|
||||||
|
logger.warn('Chat command failed after broadcast', { socket: socket?.id, error: err.message });
|
||||||
|
sendSystemMessage(`Command failed: ${err.message || 'unknown error'}`, { nickname: 'Rover bot', bot: true });
|
||||||
|
cb({ success: true, command: true, commandError: err.message || 'Command failed' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cb({ success: true });
|
cb({ success: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,10 @@
|
|||||||
1. implement multitabbing prevention using the identity system
|
1. implement multitabbing prevention using the identity system
|
||||||
2. make google tts the default everywhere but roverd
|
2. make google tts the default everywhere but roverd
|
||||||
3. fix rover request spam queue cheat
|
3. fix rover request spam queue cheat
|
||||||
4. fix up ALL discord admin commands
|
4. make alert feed.jsx show more alerts at once
|
||||||
1. make sure all permissions are correct
|
5. unify typing row and chat row, should be simple
|
||||||
2. fuzzy search all the things
|
6. fix google TTS speeds
|
||||||
3. dont break on multi word nicknames
|
7. fix this:
|
||||||
4. make all rs commands work form both the site chat and discord
|
|
||||||
1. make sure all the permissions are correct
|
|
||||||
5. make alert feed.jsx show more alerts at once
|
|
||||||
6. unify typing row and chat row, should be simple
|
|
||||||
7. fix google TTS speeds
|
|
||||||
8. fix this:
|
|
||||||
`Jun 18 15:14:18 roombaserver.local node[216731]: /home/daniel/MultiRoombaRover/server/src/services/roverManager/socketHandlers.js:92
|
`Jun 18 15:14:18 roombaserver.local node[216731]: /home/daniel/MultiRoombaRover/server/src/services/roverManager/socketHandlers.js:92
|
||||||
Jun 18 15:14:18 roombaserver.local node[216731]: cb({ error: err.message });
|
Jun 18 15:14:18 roombaserver.local node[216731]: cb({ error: err.message });
|
||||||
Jun 18 15:14:18 roombaserver.local node[216731]: ^
|
Jun 18 15:14:18 roombaserver.local node[216731]: ^
|
||||||
|
|||||||
Reference in New Issue
Block a user