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
| Mode | Trigger | Notes |
|---|---|---|
| Bot DM | Send text directly to the bot | Good for personal status queries and remote control. |
| Server channel mention | Mention the bot in a channel and enter a question | Good for communities, developer servers, and team channels. |
| Long replies | Handled by the Device Agent automatically | Discord has per-message length limits, so long replies are split automatically. |
Prepare the Discord App
- Create an Application in Discord Developer Portal.
- Open the Bot page and copy or reset the Bot Token.
- Enable Message Content Intent on the Bot page.
- Open OAuth2 → URL Generator:
- Select
botunder Scopes. - Select
View Channels,Send Messages, andRead Message Historyunder Bot Permissions.
- Select
- Open the generated authorization URL and add the bot to the target server.
Do not only install the app from the Installation page. The invite URL must include scope=bot, or the app may not join as a bot.
Configure Device Agent
Open Settings → Channels → Discord and fill in:
| Field | .env | Description |
|---|---|---|
| Enabled | DISCORD_ENABLED | Starts the Discord channel |
| Bot Token | DISCORD_BOT_TOKEN | Discord Bot Token |
| Allow list | DISCORD_ALLOW_FROM | Optional 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,2345678901Restart the service after saving.
Verify Access
- Confirm the service has restarted.
- Check logs for
Discord: enabledandLogged in as .... - Send a DM to the bot, or send
@Device Agent helloin a server channel. - If the allow list is enabled, make sure the sender Snowflake ID is included.
Discord has per-message length limits. Long Device Agent replies are split automatically.
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.