mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 02:15:57 +00:00
handleMessage ran an extra IsAllowed(senderID) check after checkDMPolicy/checkGroupPolicy, creating a double-gate. When DM/Group policy was set to "pairing" or "allowlist" with an allowlist configured, paired users were wrongly rejected because they were not individually listed. Telegram has no such post-policy gate — CheckDMPolicy and CheckGroupPolicy already handle allowlist + pairing correctly. Removing the redundant check aligns Discord with the shared policy semantics and fixes issue #985.
This commit is contained in:
1 parent
860bfff38f
commit
f9e6c8817d
1 file changed
-9
@@ -58,15 +58,6 @@ func (c *Channel) handleMessage(_ *discordgo.Session, m *discordgo.MessageCreate
|
||||
}
|
||||
}
|
||||
|
||||
// Check allowlist (for "open" policy, still apply allowlist if configured)
|
||||
if !c.IsAllowed(senderID) {
|
||||
slog.Debug("discord message rejected by allowlist",
|
||||
"user_id", senderID,
|
||||
"username", senderName,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
// Handle bot commands (writer management, etc.) before further processing.
|
||||
if c.tryHandleCommand(m) {
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user