Discord: add allowBots config option (#802)

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

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(