Connect a chatbot to Discord so people can ask it questions with an /ask slash command, in a server channel or a direct message. Pro plan only.
It answers /ask. It does not read ordinary messages.
Discord only delivers plain chat messages over a Gateway WebSocket — a connection a bot must hold open permanently. Aimy runs on request-and-response web hosting, which cannot hold one. Slash commands arrive over a normal webhook, which is why that is what this supports.
This is a real capability, not a placeholder, and it has one advantage over listening to everything: the bot only ever answers when someone deliberately asks, so it cannot be pulled into a conversation and billed for it.
1. Create it. Go to the Discord Developer Portal → New Application. Name it and accept the terms.
2. Copy two values from General Information:
3. Add a bot and copy its token. Open the Bot tab → Add Bot → Reset Token → copy. Discord shows a bot token exactly once; if you lose it, reset again.
4. Open the integration. Integrations → the Discord card → pick your chatbot from the tabs.
5. Paste all three values — Application ID, Public key, Bot token — and click Connect.
Verify: connecting also registers the /ask command against your application, which is what proves the Application ID and bot token are a valid pair. If you see "Discord rejected that bot token", one of the two is wrong.
6. Copy the Interactions endpoint URL from the box that appears.
7. Paste it into Discord. Back on General Information, paste it into Interactions Endpoint URL and click Save Changes.
Verify — and this one is a genuine test. Discord immediately sends several requests, some with deliberately invalid signatures, and refuses to save the URL unless the bad ones are rejected with a 401. If it saves, your signature verification is provably correct. If it says the endpoint could not be validated, the public key is wrong.
8. Build an invite link. Open OAuth2 → URL Generator, tick applications.commands under Scopes (and bot if you want it visible in the member list).
9. Open the generated URL, pick your server, and authorise.
10. Wait, if you have to. Global slash commands can take up to an hour to appear in every server. If /ask does not autocomplete yet, this is why — it is not a failure.
11. Run it. In any channel the bot can see, type /ask, pick the command, and enter a real question your documents can answer.
Verify: you should see "thinking…" appear almost instantly, then be replaced by the answer a few seconds later. That two-stage behaviour is correct and expected — see below.
Discord discards an interaction that is not acknowledged within three seconds, showing "The application did not respond". Our answers take longer, so Aimy replies immediately with a deferred response — the "thinking…" state — which buys fifteen minutes to fill in the real answer.
A background worker then edits that placeholder with the answer. If a reply is longer than Discord's 2,000-character limit, the first part replaces the placeholder and the rest arrive as follow-up messages.
Live agent handoff on Discord expires after 15 minutes. The interaction token is the only way Discord gives us to reach the person who ran the command, and it dies after fifteen minutes — often less than a human takes to pick up a conversation. Handoff works for a fast takeover and fails honestly for a slow one, and the agent is told their reply did not land.
Fixing that properly needs the same always-on Gateway connection that plain message support would require.
/ask does not appear. Wait up to an hour, confirm the invite included applications.commands, or click Test & re-register /ask in Aimy.channel_reply_worker./ask command registered on Discord's side — we cannot know the application is not shared with something else. Remove the endpoint URL in the Developer Portal to stop it appearing.