Ignore system messages in Discord handler

Added check to ignore system messages in Discord bot.
This commit is contained in:
VasilyKaiser 2026-02-22 10:50:16 +01:00 committed by GitHub
parent cec6fd4cd4
commit 386fbeb330
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -176,6 +176,15 @@ func (c *DiscordChannel) handleMessage(s *discordgo.Session, m *discordgo.Messag
return
}
// Ignore system messages (including thread creation messages)
// MessageTypeDefault (0) = regular user message
if m.Type != discordgo.MessageTypeDefault {
logger.DebugCF("discord", "Message ignored - system message", map[string]any{
"message_type": int(m.Type),
})
return
}
// Check allowlist first to avoid downloading attachments and transcribing for rejected users
if !c.IsAllowed(m.Author.ID) {
logger.DebugCF("discord", "Message rejected by allowlist", map[string]any{