Skip to content

Discord ​

Discord access uses the Discord Gateway so users can DM the bot or mention it in a server channel to query status, control devices, or ask questions; server messages trigger only when the bot is mentioned, while DMs trigger directly.

Usage Modes ​

ModeTriggerNotes
Bot DMSend text directly to the botGood for personal status queries and remote control.
Server channel mentionMention the bot in a channel and enter a questionGood for communities, developer servers, and team channels.
Long repliesHandled by the Device Agent automaticallyDiscord has per-message length limits, so long replies are split automatically.

Prepare the Discord App ​

  1. Create an Application in Discord Developer Portal.
  2. Open the Bot page and copy or reset the Bot Token.
  3. Enable Message Content Intent on the Bot page.
  4. Open OAuth2 → URL Generator:
    • Select bot under Scopes.
    • Select View Channels, Send Messages, and Read Message History under Bot Permissions.
  5. Open the generated authorization URL and add the bot to the target server.

Include scope=bot in the invite URL to add the app as a bot. Installing only from the Installation page may not complete this step.

Configure Device Agent ​

Open Settings → Channels → Discord and fill in:

Field.envDescription
EnabledDISCORD_ENABLEDStarts the Discord channel
Bot TokenDISCORD_BOT_TOKENDiscord Bot Token
Allow listDISCORD_ALLOW_FROMOptional Discord user Snowflake ID allow list

You can also configure it in .env:

bash
DISCORD_ENABLED=true
DISCORD_BOT_TOKEN=your-discord-bot-token
DISCORD_ALLOW_FROM=1234567890,2345678901

Restart the service after saving. For a platform deployment, ask the deployment administrator to restart the relevant services.

Verify Access ​

  1. Confirm that the saved configuration has taken effect.
  2. Check logs for Discord: enabled and Logged in as ....
  3. Send a DM to the bot, or send @Device Agent hello in a server channel.
  4. If the allow list is enabled, make sure the sender Snowflake ID is included.

See Usage Modes for long replies.

Checks ​

  • Used disallowed intents: enable Message Content Intent on the Bot page.
  • No server channel response: mention the bot and confirm it can read and send messages.
  • Allow list blocks messages: use user IDs, not usernames.