Discord Application Setup
Before installing the bot you need to create a Discord application and bot account at the Discord Developer Portal.
1. Create the Application
- Go to https://discord.com/developers/applications and click New Application.
- Give it a name (e.g.
ArkenBot) and click Create. - Note the Application ID — this becomes your
DISCORD_CLIENT_IDenvironment variable.
2. Create the Bot Account
- In the left sidebar click Bot.
- Click Add Bot → Yes, do it!
- Under Token, click Reset Token and copy the value — this is your
DISCORD_TOKEN.
Keep your bot token secret
Anyone with your bot token has full control of your bot. Never commit it to git or share it publicly.
- Scroll down to Privileged Gateway Intents and enable:
| Intent | Required for |
|---|---|
| Server Members Intent | Welcome messages, invite tracking, leveling |
| Message Content Intent | AutoMod, counting game, custom commands |
3. OAuth2 Configuration
- In the left sidebar click OAuth2 → General.
- Copy the Client Secret — this is your
DISCORD_CLIENT_SECRET. - Under Redirects, click Add Redirect and enter your dashboard callback URL:
- Local development:
http://localhost:3000/auth/callback - Production:
https://yourdomain.com/auth/callback
- Local development:
Exact match required
The redirect URI in your .env must match the one registered here exactly, including the protocol and path. A mismatch causes login to fail.
4. Invite the Bot to Your Server
- In the left sidebar click OAuth2 → URL Generator.
- Under Scopes select:
bot,applications.commands. - Under Bot Permissions select at minimum:
- Manage Roles
- Manage Channels
- Kick Members / Ban Members
- Read Messages / Send Messages
- Manage Messages
- Add Reactions
- Embed Links / Attach Files
- View Channel
- Copy the generated URL, open it in a browser, and select your server to invite the bot.
Role hierarchy
Place the ArkenBot role above any roles you want it to manage. Discord prevents bots from assigning roles that are higher than their own.