- Access the Discord's developer portal and login with your discord account. Important: You’ll need to verify your email before you’re able to move on.
- Create your application selecting
New Application
- Go to
Bot
tab and click onAdd bot
- In discord app, create a new server to test your commands
- Back to the Developer Portal and select the OAuth2 page from the left-hand navigation
- Scroll down and select bot from the SCOPES options and Administrator from BOT PERMISSIONS
- Select Copy beside the URL that was generated for you, paste it into your browser, and select your guild from the dropdown options
First, you need to install the dependencies using the command: pip3 install requirements.txt
Important: recommend use virtualenv
- Create a file named
.env
in the same directory asbot.py
:
# .env
DISCORD_TOKEN={your-bot-token}
DISCORD_GUILD={your-guild-name}
You’ll need to replace {your-bot-token}
with your bot’s token, which you can get by going back to the Bot page on the Developer Portal and clicking Copy under the TOKEN section
- Start your bot using the following command:
python bot.py
Now you can test the commands in your server.
Questions? Access this tutorial.