show original chat message

This commit is contained in:
legop3
2026-06-19 23:26:26 -04:00
parent f0a7d72f94
commit 9cf44b316d
2 changed files with 20 additions and 25 deletions
+16 -15
View File
@@ -25,21 +25,6 @@ function createHandlers({ sendSystemMessage }) {
// where an external API or rover-side feature has a real hard limit.
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 ttsOptions = normalizeTtsOptions(tts);
const message = buildMessage(socket, clean, {
@@ -64,6 +49,22 @@ function createHandlers({ sendSystemMessage }) {
broadcastMessage(message);
maybeSendAccessNotice(message, sendSystemMessage);
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 });
}
+4 -10
View File
@@ -1,16 +1,10 @@
1. implement multitabbing prevention using the identity system
2. make google tts the default everywhere but roverd
3. fix rover request spam queue cheat
4. fix up ALL discord admin commands
1. make sure all permissions are correct
2. fuzzy search all the things
3. dont break on multi word nicknames
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:
4. make alert feed.jsx show more alerts at once
5. unify typing row and chat row, should be simple
6. fix google TTS speeds
7. 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]: cb({ error: err.message });
Jun 18 15:14:18 roombaserver.local node[216731]: ^