Creating Your Bot¶
To make a bot on Discord, you must first create an application on Discord. Thankfully, Discord has made this process very simple:
-
Login to the Discord website
-
Navigate to the Developer Application page
-
Press
New Application
-
Give your application a name, and press
Create
Note
Don't worry if there isn't a
team
option, this only appears if you have a developer team. If you have a team and want to assign your bot to it, use this. -
In the
Bot
tab, pressAdd bot
-
You now have a bot! You're going to want to press
Reset Token
to get your bot's token, so you can start codingNote
You may (or may not) be asked to enter your password or 2FA authentication code to confirm this action.
Warning: Do not share your token!
Think of this token as your bots username and password in one. You should never share this with someone else. If someone has your token, they can do absolutely anything with your bot, from banning every member in every server to leaving every server your bot is in.
If you think you have leaked your token, press
Reset Token
on the same page you copy your token on, this will revoke your token (logging out all exisitng sessions), and generate a new token for you.Github will automatically revoke your token if you accidentally commit it, but don't rely on this as a crutch, keep your token safe.
Inviting your bot!¶
So you've created a bot, but it's not in a server yet. Lets fix that.
-
On the Developer Application page from above, select your bot
-
Navigate to the
OAuth2
tab -
Scroll down to the
URL Generator
. This is where we're going to create our invite link -
Select the
bot
option, and if you want to use application commands, selectapplications.commands
as well -
If your bot needs any special permissions, select those below
-
Now you have an invite link! Simply use this to invite your bot.
Note
You need
manage server
permissions to add a bot to a server