Step-by-step guide to create and configure a Discord bot for openab.
- Go to the Discord Developer Portal
- Click New Application
- Give it a name (e.g.
AgentBroker) and click Create
- In your application, go to the Bot tab (left sidebar)
- Scroll down to Privileged Gateway Intents
- Enable Message Content Intent
- Click Save Changes
- Still on the Bot tab, click Reset Token
- Copy the token — you'll need this for
DISCORD_BOT_TOKEN - Keep this token secret. If it leaks, reset it immediately
- Go to OAuth2 → URL Generator (left sidebar)
- Under Scopes, check
bot - Under Bot Permissions, check:
- Send Messages
- Send Messages in Threads
- Create Public Threads
- Read Message History
- Add Reactions
- Manage Messages
- Copy the generated URL at the bottom
- Open the URL from step 4 in your browser
- Select the server you want to add the bot to
- Click Authorize
- In Discord, go to User Settings → Advanced → enable Developer Mode
- Right-click the channel where you want the bot to respond
- Click Copy Channel ID
- Use this ID in
allowed_channelsin your config
- Make sure Developer Mode is enabled (see step 6)
- Right-click your own username (in a message or the member list)
- Click Copy User ID
- Use this ID in
allowed_usersto restrict who can interact with the bot
Set the bot token and channel ID:
# Local
export DISCORD_BOT_TOKEN="your-token-from-step-3"In config.toml:
[discord]
bot_token = "${DISCORD_BOT_TOKEN}"
allowed_channels = ["your-channel-id-from-step-6"]
# allowed_users = ["your-user-id-from-step-7"] # optional: restrict who can use the botallowed_channels |
allowed_users |
Result |
|---|---|---|
| empty | empty | All users, all channels (default) |
| set | empty | Only these channels, all users |
| empty | set | All channels, only these users |
| set | set | AND — must be in allowed channel AND allowed user |
- Empty
allowed_users(default) = no user filtering, fully backward compatible - Denied users get a 🚫 reaction and no reply
For Kubernetes:
kubectl create secret generic openab-secret \
--from-literal=discord-bot-token="your-token-from-step-3"In the allowed channel, mention the bot:
@AgentBroker hello
The bot should create a thread and respond. After that, just type in the thread — no @mention needed.
- Bot doesn't respond — check that the channel ID is correct and the bot has permissions in that channel
- "Sent invalid authentication" — the bot token is wrong or expired, reset it in the Developer Portal
- "Failed to start agent" — kiro-cli isn't authenticated, run
kiro-cli login --use-device-flowinside the container ghcommands fail with 401 — the agent needs GitHub CLI authentication. See gh auth device flow guide for how to authenticate in a headless container