NewSchokr 13 is here. A whole new UI, seven locations, snapshots and more. Read more →

How to invite your Discord bot to a server

Build an OAuth2 invite link with the bot and applications.commands scopes and the right permissions, then add your bot to a Discord server.

Updated · 2 min read

To add your bot to a server you open an OAuth2 authorization URL that includes your application ID, the bot and applications.commands scopes, and a permissions number. You need the Manage Server permission in the server you're adding it to.

The link looks like this:

https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&scope=bot+applications.commands&permissions=PERMISSIONS_NUMBER

Replace YOUR_APPLICATION_ID with the Application ID from the Developer Portal, and PERMISSIONS_NUMBER with the permissions integer for what your bot needs.

You can also generate this link in the Developer Portal under OAuth2, using the URL generator: tick the bot and applications.commands scopes, tick the permissions you want, and copy the generated URL.

Which scopes do you need?

ScopeWhy
botAdds the bot user to the server so it can connect, read and send messages.
applications.commandsLets the bot create slash commands and context menu commands in the server.

If your slash commands don't show up in a server, re-invite the bot with both scopes. You don't need to kick it first.

Choosing permissions

Give the bot only what it needs. A typical moderation-free bot needs:

  • View Channels
  • Send Messages
  • Embed Links
  • Attach Files
  • Read Message History
  • Use External Emojis
  • Add Reactions

Avoid Administrator unless you really need it. If the token ever leaks, an admin bot can wreck every server it is in, and admin hides permission mistakes you would otherwise catch during testing.

Permissions in the invite are the bot's role permissions. Channel overrides still apply, so if a channel denies Send Messages to the bot's role, the bot can't post there even if the invite granted it.

Add the bot

  1. Open the invite link in your browser.
  2. Pick the server from the list. Only servers where you have Manage Server appear.
  3. Review the permissions and click Authorize.
  4. Complete the captcha if asked.

The bot appears in the member list. It shows as offline until your code is running and logged in.

Troubleshooting

  • "Integration requires code grant": turn off Requires OAuth2 Code Grant on the Bot page.
  • The server isn't in the list: you lack Manage Server there, or you're signed in to a different Discord account in the browser.
  • Other people can't add the bot: Public Bot is off, so only you (the owner) can invite it. That's expected for private bots; turn it on if you want others to add it.
  • Bot joined but is offline: the bot isn't running. Start it on Schokr and check the console. See bot keeps going offline.