Creating a Discord bot account
Create the Discord application, turn on the two privileged intents, and copy the token your bot logs in with.
Both a custom bot and a self-hosted bot log in with your own Discord application. You create it once, in the Discord Developer Portal.
Create the application
Open the Developer Portal
Open discord.com/developers/applications?new_application=true and sign in with the Discord account that should own the bot. That link opens the New Application dialog for you; you can also click New Application at the top right of the portal.
Create the application
Give it a name, accept the developer terms and click Create. The name you type here is the name your bot shows in Discord, so use the one you actually want, and use a dedicated application instead of reusing a bot you already run.

Upload the avatar and banner here too; this is the only place that changes the bot's Discord profile.
Turn on the privileged intents
Open the Bot tab and scroll to Privileged Gateway Intents. Member Counter needs two of the three. Set them as below and click Save Changes.
Presence Intent
On
Tells Online, Idle and Do Not Disturb apart, and powers the "playing a game" member filter
Server Members Intent
On
Counts members exactly and powers the role and account-type filters
Message Content Intent
Off
Member Counter never reads message content

Copy the token
Still in the Bot tab, click Reset Token and confirm. Discord shows the token once. Copy it and keep it somewhere safe.

Resetting the token invalidates the old one, so a bot already running on it stops working until you paste the new one. Where the token goes next:
Custom bot: paste it into Discord Bot Token in the dashboard. See Setting up a custom bot.
Self-hosted bot: put it in
DISCORD_BOT_INSTANCE_TOKENin your.env. See Configuration.
OAuth2 credentials
Self-hosting only: a self-hosted bot also needs the OAuth2 client id, secret and redirect URL from the same application. See Configuration.

Last updated