Ignore system messages in Discord handler
Added check to ignore system messages in Discord bot.
This commit is contained in:
parent
cec6fd4cd4
commit
386fbeb330
1 changed files with 9 additions and 0 deletions
|
|
@ -176,6 +176,15 @@ func (c *DiscordChannel) handleMessage(s *discordgo.Session, m *discordgo.Messag
|
||||||
return
|
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
|
// Check allowlist first to avoid downloading attachments and transcribing for rejected users
|
||||||
if !c.IsAllowed(m.Author.ID) {
|
if !c.IsAllowed(m.Author.ID) {
|
||||||
logger.DebugCF("discord", "Message rejected by allowlist", map[string]any{
|
logger.DebugCF("discord", "Message rejected by allowlist", map[string]any{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue