fix(discord): remove redundant allowlist gate that broke pairing/allowlist policies (#985) (#1010)

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:
Duy /zuey/ authored and GitHub committed 2026-04-23 23:48:11 +07:00
1 parent 860bfff38f
commit f9e6c8817d
1 file changed
-9
-9
View File
@@ -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