Guides › Discord
How to make a Discord bot
Every Discord bot is an application you create in Discord's developer portal. The application gives you a secret token - the bot's password - and an invite link that adds the bot to your server. This guide covers the three places people usually get stuck: the token, the intents and the permissions.
1. Create the application
- Go to discord.com/developers/applications and sign in.
- Press New Application, give it the name your members will see, accept the terms and create it.
- Optional: upload an icon on the General Information page - it becomes the bot's avatar.
2. Get the token
Open the Bot page and press Reset Token. Copy it straight into your bot's Connect page. Discord shows a token only once; if you lose it, reset it again (the old one stops working).
3. Turn on the intents
Still on the Bot page, under Privileged Gateway Intents, switch on:
- Message Content Intent - without it the bot sees that a message was sent, but not what it says, so commands and keywords never match.
- Server Members Intent - needed for welcome messages when someone joins.
Bots in fewer than 100 servers can switch these on freely; larger bots need Discord's verification.
4. Invite the bot with the right permissions
- Open OAuth2 › URL Generator.
- Scopes: tick
botandapplications.commands. - Bot permissions: Send Messages, Manage Messages (to delete spam), Add Reactions and Read Message History.
- Open the generated link, pick your server and authorise.
Avoid giving the bot Administrator. A bot only needs what its rules use; fewer permissions means less damage if a token ever leaks.
5. Find channel IDs
Scheduled posts and welcome messages need a channel ID. In Discord, open User Settings › Advanced and turn on Developer Mode, then right-click any channel and choose Copy Channel ID.
6. Check the role order
Discord only lets a bot moderate members whose highest role is below the bot's role. Drag the bot's role above your member roles in Server Settings › Roles if deleting or moderating doesn't work.
Ideas for your first rules
- A welcome message in #welcome with a link to the rules.
- !rules, !discord and !events commands with fixed answers.
- Moderation that removes invite links and floods, but never touches admins.
- A weekly announcement for your server's regular event.