Initial commit: Discord-Claude Gateway with event-driven agent runtime

This commit is contained in:
2026-02-22 01:07:02 -05:00
parent ffcbcd874a
commit 8bb11b19d8
3 changed files with 68 additions and 46 deletions

View File

@@ -21,7 +21,10 @@ export function shouldIgnoreMessage(message: { author: { bot: boolean } }): bool
}
export function extractPromptFromMention(content: string, botId: string): string {
return content.replace(new RegExp(`<@!?${botId}>`, "g"), "").trim();
// Remove user mentions (<@ID> or <@!ID>) and role mentions (<@&ID>) for the bot
return content
.replace(/<@[!&]?\d+>/g, "")
.trim();
}
export class DiscordBot {