Discord
Anyy uses a Discord bot token with the official Gateway connection profile. The adapter supports direct messages, guild channels, Discord threads, inbound attachments, pairing, and live health checks.
1. Create the Discord Application
In the Discord Developer Portal:
- Create an application and add a bot user.
- Copy the bot token into a secure password manager.
- Configure Gateway intents for the conversations you enable.
- Install the bot into the intended server with permission to view and send messages.
Anyy calculates required intents from policy. Direct messages require the direct-message intent; enabled guild messages require the guild-message intent. open or allowlist group policy also requires Message Content intent. Dashboard lists the matching external prerequisites.
2. Add Discord to Anyy
Open Dashboard → Channels → Add channel → Discord. Choose Bot Gateway, add the bot token, then choose DM and group policies.
CLI setup:
anyy setup channel discord
The bot token is stored as a Profile secret. When enabled, Anyy verifies both the authenticated bot identity and application identity before accepting the connection.
3. Set Policies
Discord defaults to pairing for direct messages and mention for groups.
| Policy | DM | Group |
|---|---|---|
pairing | Yes | Yes |
allowlist | Yes | Yes |
open | Yes | Yes |
mention | — | Yes |
disabled | Yes | Yes |
Use Discord user IDs in the sender allowlist and channel/guild identities supplied by the channel surface for group restrictions.
4. Verify the Connection
anyy channel reload
anyy channel doctor discord
Send a direct message or mention the bot in an allowed guild channel. Approve a new DM sender when Pairing is active:
anyy channel pairing list --channel discord
anyy channel pairing approve --request REQUEST_ID
Threads and Attachments
Discord thread identity is preserved in the conversation route, so replies return to the same thread. Inbound attachments are downloaded into the scoped Anyy session when they pass media limits.
Do not grant broader Discord permissions than the bot needs. Tool and model permissions are controlled by Anyy, but Discord permissions determine where the bot can read or post.
If you widen group policy, update the corresponding Discord Gateway intents and reload Anyy. A valid token alone does not guarantee message events are delivered.
Troubleshooting
| Symptom | Check |
|---|---|
| Bot authenticates but receives no guild messages | Review guild/message intents, bot installation, channel permissions, and group policy |
| Only mentions work | This is expected with default mention policy |
| DM waits for approval | Approve the pairing request, then send a new DM |
| Replies go to the wrong place | Confirm the event contains the intended channel/thread identity |
| Attachment is missing | Check Discord URL access, file size, media limit, and diagnostic output |
For shared pairing and reload behavior, see Messaging Platforms.