Skip to content

Latest commit

 

History

History
71 lines (48 loc) · 2.53 KB

File metadata and controls

71 lines (48 loc) · 2.53 KB

Discord Bot Setup

To run and develop the bot locally, you need to create a Discord bot application and add it to your own "staging" server.

Create a Bot Application

Follow the Discord.js guides:

  1. Creating your bot
  2. Adding your bot to servers

Required Permissions

The bot needs the Message Content Intent and Server Members Intent permissions turned on.

Click for visual DCS_bot_perms

Required Scopes

The bot needs applications.commands and bot scopes.

Click for visual Screenshot 2024-11-24 at 12 34 09 PM

Generate Invite Link

Generate an invite link for the bot and enter it into any browser.

Click for visual Screenshot 2024-11-24 at 12 44 08 PM

Note

Bot permissions involving threads/mentions/messages should suffice, but you can give it Administrator since it's just a test bot in your own testing Discord server.

Environment Variables

Add these to your .env file:

DISCORD_TOKEN=                      # Bot token (production)
DISCORD_DEBUG_TOKEN=                # Bot token (local development)
DISCORD_CLUSTER_STAGING_ID=         # Server ID (production)
DISCORD_DEBUG_CLUSTER_STAGING_ID=   # Server ID (local development)

Note

For local development, you can set the DEBUG variants to the same values as the production ones.

Finding Your Bot Token

Found in your bot's page within the Discord Developer Portal:

Click for visual Screenshot 2024-11-24 at 11 01 19 AM

Finding Your Server ID

Right-click your staging Discord server and select Copy Server ID:

Click for visual Screenshot 2024-11-24 at 10 58 27 AM