How do I create an invite link for my Discord bot?
- Open the Discord Developer Portal and select your application.
- On the General Information page, copy the Application ID and paste it into the generator above.
- Choose the scopes. For a bot that joins servers, keep
bot; it already includesapplications.commands. - Pick the permissions the bot needs, from a preset or one by one. Ask for what the bot uses, not for everything.
- Copy the link, or open it in your browser. Discord asks which server to add the bot to.
The Developer Portal can also make a link for you: on the Installation page, the Discord Provided Link uses the default install settings you set there, and it is limited to the bot and applications.commands scopes.
What do the bot and applications.commands scopes do?
A scope is what the link asks Discord to grant. bot puts the bot user in the server picked in the invite dialog. applications.commands lets the app add its commands, and Discord includes it by default with the bot scope, so ticking both changes nothing for a bot install.
Any other scope turns the link into a full OAuth2 authorization code grant, which needs a response_type and a redirect_uri handled by your own server. This generator builds bot links only, so it offers these two scopes and never needs a redirect.
What is the permissions integer?
Every Discord permission is one bit: Create Invite is 1, Kick Members is 2, Administrator is 8, and so on. The permissions integer is those bits added together, and it is the permissions value of the invite link. The generator does that sum for you, and reads an integer back into checkboxes when you paste one.
Discord sends permissions as strings in API v8 and above. The generator does the same maths on big integers, so a value past JavaScript's safe integer range stays exact.
The permissions are requested for the role the bot gets when it joins. They only count where channel overwrites allow them, except Administrator, which bypasses channel permission overwrites.
What permissions does a music bot need?
A voice music bot needs to reach the channel, play into it and talk in chat:
- View Channel, to see the voice channel and the text channel at all.
- Connect, to join a voice channel, and Speak, to be heard in it.
- Send Messages, Embed Links and Read Message History, for now-playing messages and replies.
- Request to Speak, to ask to speak in a Stage channel. A bot can only make itself a Stage speaker without asking if it has Mute Members.
That is the Music bot preset above. Channel overwrites still apply: a bot denied View Channel or Connect on a channel cannot join it, whatever its role allows.
Guild install vs user install
An app can be installed to a server, to a user, or both, and the invite link picks one with integration_type, which Discord reads when the scopes include applications.commands.
- Server install (
integration_type=0): someone with the Manage Server permission adds the app to a server, and every member of that server can see it. This generator only puts thebotscope and bot permissions in a server install link. - User install (
integration_type=1): the app is added to your account and only you see it, in your servers, DMs and group DMs, limited by your own permissions wherever you use it. Discord's guide to user-installable apps listsapplications.commandsas the only scope a user install supports (at the time of writing), so the link carries no bot and no permissions.
A user install link only works for an app that supports it: on the Installation page of the Developer Portal, User Install has to be checked under Installation Contexts.
Frequently asked questions
Can I make the invite add the bot to one specific server?
Yes. Enter the server ID: the link carries it as guild_id, which pre-selects that server in Discord's picker. Tick Lock the invite to this server to add disable_guild_select=true, which stops the person inviting from choosing another one.
Why can't my bot kick or ban someone, even with the permission?
Discord's role hierarchy: a bot can only kick, ban and edit nicknames of members whose highest role is lower than the bot's highest role, and can only grant roles below its own. Move the bot's role above theirs.
What does the 2FA badge mean?
Discord marks some permissions, such as Administrator, Ban Members and Manage Messages, as requiring the owner account to use two-factor authentication when they are used on a server that has server-wide 2FA enabled.
Should I just ask for Administrator?
Administrator allows every permission and bypasses channel permission overwrites. It is simple, and it also means the bot can do anything on the server if it misbehaves or its token leaks. Ask for the permissions the bot actually uses whenever you can.
Does the link need a redirect URI?
No. A link with only the bot and applications.commands scopes needs no redirect_uri or response_type.