diff --git a/src/backend/chatClient/clientActions/say/index.ts b/src/backend/chatClient/clientActions/say/index.ts index 89d7626..8d04801 100644 --- a/src/backend/chatClient/clientActions/say/index.ts +++ b/src/backend/chatClient/clientActions/say/index.ts @@ -1,7 +1,18 @@ import { chatClient } from "../.."; -// send a chat message +const maxMessageLength = 500; + async function say(channel: string, message: string): Promise { + message = `MrDestructoid ${message}`; + + if (message.length > 500) { + const suffix = "..."; + message = `${message.substring( + 0, + maxMessageLength - suffix.length + )}${suffix}`; + } + await chatClient.say(channel, message); }