Discord - BluDood/BluDoodAPI GitHub Wiki

Setting up environment variables for Discord

To activate the /discord and /ws endpoints, you will have to create a Discord application. Here are the steps:

Steps

Create a Discord Application

  1. Head over to https://discord.com/developers/applications and click "New Application". Give it a name, and click "Create".
  2. Click the "Bot" tab
  3. Under Privileged Gateway Intents, enable "PRESENCE INTENT".
  4. Under "Token", press the "Reset Token" button. Authenticate with MFA if you have to.
  5. Press "Copy" to copy your Discord bot token.
  6. You can now paste it into your .env file:
DISCORD_BOT_TOKEN=your_bot_token

Getting your Discord User ID

  1. In your Discord client, head over to the Advanced tab in Settings, and enable "Developer Mode".
  2. Now, click on your profile in the lower left, and click "Copy User ID"
  3. Then, paste it into your .env file as follows:
DISCORD_USER_ID=your_user_id

That's it! The /discord endpoint should be enabled the next time you restart the server, and should display your current activity and user info. The /ws WebSocket endpoint should also be active, sending new presence data when they come in.