LemonChannels. Adapters. WhatsApp. AccessControl
(lemon_channels v0.1.0)
View Source
Pure functions for WhatsApp access control.
DM modes: :pairing, :allowlist, :open, :disabled Group modes: :open, :allowlist, :disabled
Summary
Functions
Main entry point. Returns true if the message from jid should be processed. event may contain :mentioned_jids for group mention gating.
Returns true if the DM from jid is allowed based on dm_mode config.
Returns true if jid ends with @s.whatsapp.net (DM JID).
Returns true if the group message from jid is allowed based on group_mode config.
Returns true if jid ends with @g.us (group JID).
Returns true if the phone number from jid is in the config allowlist.
Returns true if the bot must be @mentioned but was not. For groups with mention_gated: true, the bot JID must appear in mentioned_jids.
Extracts the phone number (or group id) from a JID by taking everything before @.
Returns true if jid matches the bot's own JID (self-chat).
Functions
Main entry point. Returns true if the message from jid should be processed. event may contain :mentioned_jids for group mention gating.
Returns true if the DM from jid is allowed based on dm_mode config.
Returns true if jid ends with @s.whatsapp.net (DM JID).
Returns true if the group message from jid is allowed based on group_mode config.
Returns true if jid ends with @g.us (group JID).
Returns true if the phone number from jid is in the config allowlist.
Returns true if the bot must be @mentioned but was not. For groups with mention_gated: true, the bot JID must appear in mentioned_jids.
Extracts the phone number (or group id) from a JID by taking everything before @.
Returns true if jid matches the bot's own JID (self-chat).