How to Create Discord Bot
Step 1: Create a New Application & Bot
Visit the Discord Developer Portal.
Click New Application and give your bot a name.
In the left sidebar, go to the Bot tab and click Add Bot.
Click Reset Token and copy your bot token. Keep this token safe! You’ll need it to run your bot.
Step 2: Enable Privileged Intents
In the Bot tab, scroll down to the Privileged Gateway Intents section.
Enable the following intents by toggling them on:
Presence Intent
Server Members Intent
Message Content Intent
Click Save Changes at the bottom.
Step 3: Generate an OAuth2 Invite Link
Go to the OAuth2 tab, then select URL Generator in the sidebar.
Under Scopes, check:
botapplications.commands
Under Bot Permissions, select the permissions your bot needs. For most bots, you’ll want:
Administrator(gives all permissions, use with caution)Or select specific permissions like:
Manage RolesSend MessagesRead Message HistoryUse Slash Commands
Copy the generated URL at the bottom of the page.
Paste the URL into your browser and invite your bot to your Discord server.
Your bot is now created and invited! Next, use your bot token in your code to bring your bot online.
Last updated