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
- Head over to https://discord.com/developers/applications and click "New Application". Give it a name, and click "Create".
- Click the "Bot" tab
- Under Privileged Gateway Intents, enable "PRESENCE INTENT".
- Under "Token", press the "Reset Token" button. Authenticate with MFA if you have to.
- Press "Copy" to copy your Discord bot token.
- You can now paste it into your .env file:
DISCORD_BOT_TOKEN=your_bot_token
Getting your Discord User ID
- In your Discord client, head over to the Advanced tab in Settings, and enable "Developer Mode".
- Now, click on your profile in the lower left, and click "Copy User ID"
- 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.