Skip to content

Intents

Intents control which gateway events your bot receives. Pass them as a list when starting Lingo:

elixir
{Lingo,
 bot: MyBot.Bot,
 token: token,
 intents: [:guilds, :guild_messages, :message_content]}

All Intents

IntentBitEvents
:guilds0guild_create, guild_update, guild_delete, channel_create, channel_update, channel_delete, channel_pins_update, thread_create, thread_update, thread_delete, thread_list_sync, thread_member_update, thread_members_update, stage_instance_create, stage_instance_update, stage_instance_delete
:guild_members1guild_member_add, guild_member_update, guild_member_remove
:guild_moderation2guild_audit_log_entry_create, guild_ban_add, guild_ban_remove
:guild_expressions3guild_emojis_update, guild_stickers_update, guild_soundboard_sound_create, guild_soundboard_sound_update, guild_soundboard_sound_delete, guild_soundboard_sounds_update
:guild_integrations4guild_integrations_update, integration_create, integration_update, integration_delete
:guild_webhooks5webhooks_update
:guild_invites6invite_create, invite_delete
:guild_voice_states7voice_state_update
:guild_presences8presence_update
:guild_messages9message_create, message_update, message_delete, message_delete_bulk
:guild_message_reactions10message_reaction_add, message_reaction_remove, message_reaction_remove_all, message_reaction_remove_emoji
:guild_message_typing11typing_start
:direct_messages12message_create, message_update, message_delete, channel_pins_update (in DMs)
:direct_message_reactions13message_reaction_add, message_reaction_remove, message_reaction_remove_all, message_reaction_remove_emoji (in DMs)
:direct_message_typing14typing_start (in DMs)
:message_content15Populates content, embeds, attachments, components, poll fields on message events
:guild_scheduled_events16guild_scheduled_event_create, guild_scheduled_event_update, guild_scheduled_event_delete, guild_scheduled_event_user_add, guild_scheduled_event_user_remove
:auto_moderation_configuration20auto_moderation_rule_create, auto_moderation_rule_update, auto_moderation_rule_delete
:auto_moderation_execution21auto_moderation_action_execution
:guild_message_polls24message_poll_vote_add, message_poll_vote_remove
:direct_message_polls25message_poll_vote_add, message_poll_vote_remove (in DMs)

Privileged Intents

Three intents are privileged and need extra setup in the application settings:

  • :guild_members: needed for member add/update/remove events
  • :guild_presences: needed for presence updates
  • :message_content: needed to see message content in guild messages

Without :message_content, message_create events still fire but content, embeds, attachments, and components will be empty for messages the bot didn't send and that don't mention it.

Raw Integer

You can pass a bitfield integer instead of a list:

elixir
{Lingo, bot: MyBot.Bot, token: token, intents: 3276799}

Helper Functions

On Lingo.Gateway.Intents (not re-exported on Lingo):

FunctionDescription
Lingo.Gateway.Intents.resolve(list)Convert a list of atoms to a bitfield
Lingo.Gateway.Intents.all()Bitfield with everything enabled
Lingo.Gateway.Intents.non_privileged()Bitfield with only non-privileged intents
Lingo.Gateway.Intents.privileged?(intent)Check if an intent is privileged
Lingo.Gateway.Intents.names()List all intent atom names