Discord: add allowBots config option (#802)

Co-authored-by: Shadow <shadow@clawd.bot>
This commit is contained in:
Zach KnickerbockerandShadow authored and GitHub committed 2026-01-12 15:30:05 -06:00
1 parent 490cb834e5
commit 3467b0ba07
7 files changed
+20 -1

No files matched your search

+11 -1
View File
@@ -647,7 +647,17 @@ export function createDiscordMessageHandler(params: {
try {
const message = data.message;
const author = data.author;
if (!author || author.bot) return;
if (!author) return;
const allowBots = discordConfig?.allowBots ?? false;
if (author.bot) {
// Always ignore own messages to prevent self-reply loops
if (botUserId && author.id === botUserId) return;
if (!allowBots) {
logVerbose("discord: drop bot message (allowBots=false)");
return;
}
}
const isGuildMessage = Boolean(data.guild_id);
const channelInfo = await resolveDiscordChannelInfo(