Intents
Intents are what a bot has to ask for before it can see something about other people. There are three, named and numbered as Discord's, and each is off until you turn it on for the application on the Bot tab of the Developer Portal.
| Intent | Bit | What it unlocks |
|---|---|---|
SERVER_MEMBERS | 1 << 1 (2) | Listing a server's members: their names and roles. Without it a bot can still fetch one member whose id it knows. |
PRESENCE | 1 << 8 (256) | Whether members are online. People who hide their status are never shown, intent or not. |
MESSAGE_CONTENT | 1 << 15 (32768) | The words, embeds, components and files of messages that are not the bot's own. |
Message content
Without MESSAGE_CONTENT, a bot reads its own messages, messages that mention it, and messages that reply to one of its messages. Every other message comes back with empty content, embeds, components and attachments, and content_withheld: true, so a bot knows the difference between "nothing was said" and "you may not read it".
A message the bot may not readJSON
json
{
"id": "4c8e1a7b-2f90-4d36-b5e1-7a3c9d0f6e82",
"channel_id": "2d7c4a90-1b3e-4f58-9a6c-8e0b5d3c7f14",
"content": "",
"attachments": [],
"content_withheld": true
}The other fields are there as always; this shows only the ones that matter. embeds and components are left out.
The reason is the same as Discord's: reading everything said in a server is a power, and a server's members never agreed to it by adding a bot that only wanted to answer /roll. Commands and buttons do not need the intent: an interaction carries everything the member chose to send.
Who sees what
- Turning an intent on is a setting of the application. It is recorded in the application's activity log.
- A bot that is added to a server a person manages can be given every intent the application has, but a member can see in the server's settings that the bot is there and which role it has.
- As the platform grows, the intents that reach many people's data (members, presence, message content) will need approval once an application is in many servers, as on Discord. Today a draft or published application may turn them on without review.