Refactor message type handling for Discord messages
Update as suggested to ignore type of message we don't want for sure.
This commit is contained in:
parent
386fbeb330
commit
d4fda7bf69
1 changed files with 9 additions and 7 deletions
|
|
@ -176,13 +176,15 @@ func (c *DiscordChannel) handleMessage(s *discordgo.Session, m *discordgo.Messag
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore system messages (including thread creation messages)
|
// Ignore system messages (thread creation, pins, boosts, etc.)
|
||||||
// MessageTypeDefault (0) = regular user message
|
switch m.Type {
|
||||||
if m.Type != discordgo.MessageTypeDefault {
|
case discordgo.MessageTypeDefault, discordgo.MessageTypeReply:
|
||||||
logger.DebugCF("discord", "Message ignored - system message", map[string]any{
|
// These are real user messages, process them
|
||||||
"message_type": int(m.Type),
|
default:
|
||||||
})
|
logger.DebugCF("discord", "Message ignored - system message", map[string]any{
|
||||||
return
|
"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
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue