How to make a Discord bot invite link

By Better Tickets Team · Updated

A Discord bot invite link is an OAuth2 URL that adds your app to a server. It needs your application's client ID, the scopes you're asking for (bot, and usually applications.commands) and a permissions integer. The fastest way to build one is the Discord permissions calculator: tick the permissions, paste your client ID and copy the link. This guide explains each part so you can get it right.

Here is a typical link, broken onto separate lines:

text
https://discord.com/oauth2/authorize
  ?client_id=123456789012345678
  &scope=bot%20applications.commands
  &permissions=3072
  &integration_type=0
ParameterWhat it does
client_idYour application's ID from the Developer Portal
scopeWhat you're requesting. bot adds a bot user to the server; applications.commands lets the app register slash commands
permissionsThe permission integer the bot's role gets
integration_type0 installs to a server, 1 installs to a user's account
guild_idOptional. Preselects a server in the picker
disable_guild_selectOptional. With true, the person can't pick a different server

These parameters come from Discord's OAuth2 documentation, which also notes that applications.commands is included by default with the bot scope. Listing both doesn't hurt.

Step by step

1

Find your client ID

Open your app in the Discord Developer Portal. The Application ID on General Information is your client ID.

2

Choose the permissions

List what your bot actually does and pick only those permissions. A ticket bot needs to manage channels and roles; a bot that only replies to commands needs to view channels and send messages.

3

Build the link

Paste the client ID into the permissions calculator, tick the permissions and choose Server. Copy the link it generates.

4

Test it

Open the link, pick a test server (you need Manage Server there) and confirm. Check that the bot's new role has the permissions you expected.

Ask for the fewest permissions you can

It's tempting to request Administrator so nothing ever fails. Don't:

  • It's a security risk. If the bot's token leaks, whoever has it can do anything in every server that granted Administrator.
  • Server owners notice. A link asking for Administrator is more likely to be rejected.
  • It hides mistakes. Administrator ignores channel overwrites, so you won't learn about permission bugs until someone removes it.

Request the specific permissions instead, and explain in your bot's docs why each one is needed. If a feature needs a permission only some servers use, ask for it when that feature is turned on rather than in the default invite.

Permissions that need 2FA

Some permissions, such as Ban Members, Kick Members, Manage Channels, Manage Roles and Administrator, only work for a bot in servers that require two-factor authentication for moderation if the bot owner's account has 2FA enabled. The permissions calculator marks them with 2FA.

Server install vs. user install

Discord apps can be installed in two ways:

  • Server install (integration_type=0) adds a bot member with the permissions in the link. This is what moderation, ticket and leveling bots use.
  • User install (integration_type=1) adds the app to a person's account so they can use its commands in any server or DM. It isn't a server member, so permissions don't apply.

Better Tickets is a server-installed bot. Its quickstart has its invite link and walks through setting up a ticket panel.

Frequently asked questions

What does a Discord bot invite link look like?

It's an OAuth2 URL such as https://discord.com/oauth2/authorize?client_id=YOUR_ID&scope=bot%20applications.commands&permissions=3072. client_id identifies your app, scope says what you're asking for, and permissions is the permission integer.

Where do I find my bot's client ID?

In the Discord Developer Portal, open your application. The Application ID on the General Information page is the client ID.

Why can't I see my server in the invite list?

You can only add a bot to servers where you have the Manage Server permission.

Can I change a bot's permissions after inviting it?

Yes. The invite creates a role for the bot with the permissions you picked. A server admin can edit that role at any time, or you can send a new invite link with different permissions.

What is a user-installed app?

An app added to a person's account rather than a server. Its commands can then be used across Discord, but it isn't a server member and has no server permissions. Use integration_type=1 in the link for this.