Discord application
By the end of this page you have a bot token, your server id and a bot sitting in your server with exactly the access it needs. You need a Discord account with Manage Server in the server the bot will join.
The bot serves one server. Its slash commands are registered to the server whose id you put in DISCORD_GUILD_ID.
Create and invite the bot
Section titled “Create and invite the bot”-
Create an application. Open the Developer Portal, name the app and press Create. A bot comes with it. On General Information, copy the Application ID. You need it in step 5.
-
Copy the token. Open the Bot page and choose Reset Token. Discord shows it once, so copy it now. It is the value for
DISCORD_TOKEN, and it works like a password: anyone who has it controls your bot. Resetting it again kills the old token, so update.envand deploy again. -
Turn on two privileged intents. An intent is a switch that lets the bot receive one kind of information from Discord, and Discord makes you turn on the sensitive ones yourself. On the Bot page, under Privileged Gateway Intents:
- Message Content Intent: on.
- Server Members Intent: on.
- Presence Intent: off.
-
Set the install options. In the left sidebar open Installation and set Install Link to None. On the Bot page turn Public Bot off, then save.
-
Build the invite link. Replace
APPLICATION_IDwith the id from step 1:https://discord.com/oauth2/authorize?client_id=APPLICATION_ID&scope=bot%20applications.commands&permissions=274879040512274879040512is the five permissions in the table below plus Connect, which only voice notes use. Use274877991936for the five alone. Use274879040528(the five, Connect and Manage Channels) only if you also want the bot to create the summary channel itself. -
Invite the bot. Open the link while logged in to Discord as the application’s owner (Public Bot is off, so nobody else can add it), pick your server and press Authorize. The bot shows as offline in the member list until you run it.
-
Copy the server id. In Discord, open User Settings, then Advanced, and turn Developer Mode on. Right-click the server and choose Copy Server ID. That is the value for
DISCORD_GUILD_ID, 17 to 20 digits. Right-click your own name and choose Copy User ID too. That is the value forREMINDER_ALLOWLISTin the first deploy.
Intents
Section titled “Intents”| Intent | Privileged | Why the bot needs it |
|---|---|---|
| Message Content | Yes | Stores and searches message text, reads tags and new messages for ticket prompts, and reads the invite link in a DM. Without it message text is empty and those features see nothing. |
| Server Members | Yes | Keeps its list of members up to date, notices who leaves, gives names to transcripts, matches members to Linear users by name and works out who can see a channel. Without it names fall back to ids and nothing is matched. |
| Presence | Yes | Not used. Leave it off. |
The bot also asks for Guilds, Guild Messages, Guild Voice States and Direct Messages. These are not privileged, so there is nothing to switch on. Guild Voice States lets the bot connect to a voice channel and notice when it empties. Direct Messages is how Discord’s Invite to voice reaches the bot: as a DM with an invite link, read through the Message Content intent. Both are always requested but used only while voice notes are on. Presence, Guild Message Reactions and Guild Voice Activity are not requested. When someone tags the bot while their earlier question is still running, the bot adds an hourglass reaction to the tag. That needs Add Reactions in the channel, which is not in the permission integers above. Without it nothing happens and nothing is logged.
If a privileged intent is off, login fails with Used disallowed intents.
Permissions
Section titled “Permissions”| Permission | Why it is on the list |
|---|---|
| View Channels | Read every channel, and see voice channels. |
| Read Message History | Backfill old messages, and reply to a specific message. |
| Send Messages | Replies in the channel when a member tags the bot to ask for a follow-up, and the answer when a tag is a question. Without it the follow-up is still saved, but no confirmation appears, and a question gets no reply (/ask still works). |
| Send Messages in Threads | The same, inside threads. |
| Embed Links | Link previews in replies. A tag question is answered only where the bot has all of View Channels, Read Message History, Embed Links and Send Messages (Send Messages in Threads in a thread). Where one is missing it stays silent and logs [follow-up] cannot answer in channel ... missing permissions. |
The five together make 274877991936. Connect, which only voice notes use, is in the optional list below.
In a channel the bot posts a short reply when a member tags it, and, when meeting transcripts are on, its replies and summaries in the meetings channel. With voice notes on it also posts a notice and the result in a voice channel’s text chat. Everything else is DMs and private replies.
A channel the bot cannot view, or cannot read the history of, is skipped by the backfill and logged as [backfill] cannot read: ....
Optional
Section titled “Optional”- Manage Threads. Not in the integer. Add it only if you want private threads backfilled later. Private threads are not stored today.
- Connect. Not in the five. Add it only for voice notes, so the bot can join a voice channel. In the voice channel the bot also needs View Channel and Send Messages, to post the notice in its text chat. They are checked in that channel, so a private voice channel must grant them. Without them
/notes startanswersAsk an admin to give me Connect, View Channel and Send Messages in that channel. - Manage Channels. Not in the integer. Add it only so the bot can create the shared summary channel of voice notes the first time a voice meeting needs it. It is server-wide and cannot be limited to one channel. If you create the channel yourself, with the name in
MEETING_CHANNEL_NAMEor the one an admin set, you do not need it. In that channel the bot needs View Channel, Send Messages and Read Message History, which the five permissions already give it when the channel is open to everyone. Without Manage Channels the bot logs[meetings] channel create failed: <class>and keeps that meeting’s summary in the voice chat.
Direct messages
Section titled “Direct messages”Sending a DM needs no permission. It fails for members who turned off DMs from server members. The reminder, scheduled summary, ticket prompt or meeting action item message is then recorded as failed with the reason dm_closed and is not sent again. Nothing needs fixing on your side. Any other Discord refusal is recorded as discord_<code>.
- Deploy to put the bot on a server with the token and server id, or Local setup to try it on your own machine.
- Configuration for every setting.
- Troubleshooting if login or commands fail.