Skip to main content
The Discord adapter connects out to the Discord Gateway over a WebSocket, so like Telegram it needs no public URL and opens no port. The bot reads every message in the channels and DMs it can see, which makes Discord’s own channel permissions the way to decide who can use it.

Set it up

1

Create the application and bot

In the Discord Developer Portal, create an application, add a Bot and copy its token.
2

Turn on the Message Content intent

Under Bot → Privileged Gateway Intents, enable Message Content Intent. The gateway requests it to read what people write; without it Discord refuses the connection.
3

Invite the bot

Use the OAuth2 URL generator with the bot scope and the permissions to read messages, send messages and attach files, then open the URL and add the bot to your server. Direct messages to the bot work as well.
4

Configure ChatCLI and start

Environment variables

Who can reach the bot

The bot answers every message from a person in every server channel and DM it can read; it does not wait for a mention and has no allow-list. Each message runs the agent with its tools and shell, so give the bot access only to a private channel, or to the people who should use it.
Messages written by bots, including this one, are ignored.

Messages

  • Text: the message content. A server channel is one conversation shared by everyone in it; a DM is its own.
  • Voice: the first audio attachment is downloaded and transcribed before the agent runs.
  • Images: the first image attachment reaches the model.
  • Image replies are uploaded as a file on the reply; on failure the text is sent alone.
  • Long replies go out as several messages in order, split at line breaks or spaces, because Discord accepts at most 2000 characters per message.
  • Replies are posted in the channel, not as a reply to the original message.

Limits

  • A reply is cut at 3500 characters before it is split, so it arrives as at most two messages.
  • After a disconnect the bot reconnects with a new session; messages sent during the gap are not delivered to it.

Troubleshooting

Enable the Message Content Intent in the Developer Portal. Without it the gateway cannot read message text and the connection is refused; ~/.chatcli/gateway.log shows the error.
Remove its permission to read those channels in the server settings. The bot has no allow-list of its own.

See also

Chat gateway

How messages run, voice, images, continuity and the other channels.

Security

Harden what the agent may do when it runs unattended.