Agent DiscordBot A TypeScript CLI tool that enables AI agents and humans to interact with Discord servers using bot tokens. Unlike agent-discord which extracts user tokens from the desktop app, agent-discordbot uses standard Discord Bot tokens for server-side and CI/CD integrations. Quick Start
Set your bot token
agent-discordbot auth set your-bot-token
Verify authentication
agent-discordbot auth status
Send a message
agent-discordbot message send 1234567890123456789 "Hello from bot!"
List channels
agent-discordbot channel list Authentication Bot Token Setup agent-discordbot uses Discord Bot tokens which you create in the Discord Developer Portal:
Set bot token (validates against Discord API before saving)
agent-discordbot auth set your-bot-token
Set with a custom bot identifier
agent-discordbot auth set your-bot-token --bot deploy --name "Deploy Bot"
Check auth status
agent-discordbot auth status
Clear stored credentials
agent-discordbot auth clear For bot token setup, server invite flow, Message Content Intent, and multi-bot management, see references/authentication.md . Memory The agent maintains a ~/.config/agent-messenger/MEMORY.md file as persistent memory across sessions. This is agent-managed — the CLI does not read or write this file. Use the Read and Write tools to manage your memory file. Reading Memory At the start of every task , read ~/.config/agent-messenger/MEMORY.md using the Read tool to load any previously discovered server IDs, channel IDs, user IDs, and preferences. If the file doesn't exist yet, that's fine — proceed without it and create it when you first have useful information to store. If the file can't be read (permissions, missing directory), proceed without memory — don't error out. Writing Memory After discovering useful information, update ~/.config/agent-messenger/MEMORY.md using the Write tool. Write triggers include: After discovering server IDs and names (from server list , etc.) After discovering useful channel IDs and names (from channel list , etc.) After discovering user IDs and names (from user list , etc.) After the user gives you an alias or preference ("call this the alerts bot", "my main server is X") After setting up bot identifiers (from auth list ) When writing, include the complete file content — the Write tool overwrites the entire file. What to Store Server IDs with names Channel IDs with names and categories User IDs with display names Bot identifiers and their purposes User-given aliases ("alerts bot", "announcements channel") Any user preference expressed during interaction What NOT to Store Never store bot tokens, credentials, or any sensitive data. Never store full message content (just IDs and channel context). Never store file upload contents. Handling Stale Data If a memorized ID returns an error (channel not found, server not found), remove it from MEMORY.md . Don't blindly trust memorized data — verify when something seems off. Prefer re-listing over using a memorized ID that might be stale. Format / Example
Agent Messenger Memory
Discord Servers (Bot)
1234567890123456
— Acme Dev
Bots (Acme Dev)
deploy
— Deploy Bot (active)
-
alert
— Alert Bot
Channels (Acme Dev)
1111111111111111
— #general (General category)
-
2222222222222222
— #engineering (Engineering category)
-
3333333333333333
— #deploys (Engineering category)
Users (Acme Dev)
4444444444444444
— Alice (server owner)
-
5555555555555555
— Bob
Aliases
"deploys" →
3333333333333333
(#deploys in Acme Dev)
Notes
Deploy Bot is used for CI/CD notifications
Alert Bot is used for error monitoring Memory lets you skip repeated channel list and server list calls. When you already know an ID from a previous session, use it directly. Commands Auth Commands
Set bot token
agent-discordbot auth set < token
agent-discordbot auth set < token
--bot deploy --name "Deploy Bot"
Check auth status
agent-discordbot auth status
Clear all credentials
agent-discordbot auth clear
List stored bots
agent-discordbot auth list
Switch active bot
agent-discordbot auth use < bot-id
Remove a stored bot
agent-discordbot auth remove < bot-id
Server Commands
List servers the bot is in
agent-discordbot server list
Show current server
agent-discordbot server current
Switch active server
agent-discordbot server switch < server-id
Get server info
agent-discordbot server info < server-id
Message Commands
Send a message
agent-discordbot message send < channel-id
< content
agent-discordbot message send 1234567890123456789 "Hello world"
List messages
agent-discordbot message list < channel-id
agent-discordbot message list 1234567890123456789 --limit 50
Get a single message by ID
agent-discordbot message get < channel-id
< message-id
Get thread replies
agent-discordbot message replies < channel-id
< message-id
agent-discordbot message replies 1234567890123456789 9876543210987654321 --limit 50
Update a message (bot's own messages only)
agent-discordbot message update < channel-id
< message-id
< new-content
Delete a message (bot's own messages only)
agent-discordbot message delete < channel-id
< message-id
--force Channel Commands
List channels in current server
agent-discordbot channel list
Get channel info
agent-discordbot channel info < channel-id
agent-discordbot channel info 1234567890123456789 User Commands
List server members
agent-discordbot user list agent-discordbot user list --limit 50
Get user info
agent-discordbot user info < user-id
Reaction Commands
Add reaction (use emoji name without colons)
agent-discordbot reaction add < channel-id
< message-id
< emoji
agent-discordbot reaction add 1234567890123456789 9876543210987654321 thumbsup
Remove reaction
agent-discordbot reaction remove < channel-id
< message-id
< emoji
File Commands
Upload file to a channel
agent-discordbot file upload < channel-id
< path
agent-discordbot file upload 1234567890123456789 ./report.pdf
List files in channel
agent-discordbot file list < channel-id
Thread Commands
Create a thread from a message
agent-discordbot thread create < channel-id
< name
agent-discordbot thread create 1234567890123456789 "Discussion" --auto-archive-duration 1440
Archive a thread
agent-discordbot thread archive < thread-id
Snapshot Command Get comprehensive server state for AI agents:
Full snapshot of current server
agent-discordbot snapshot
Filtered snapshots
agent-discordbot snapshot --channels-only agent-discordbot snapshot --users-only
Limit messages per channel
agent-discordbot snapshot
--limit
10
Returns JSON with:
Server metadata (id, name)
Channels (id, name, type, topic)
Recent messages (id, content, author, timestamp)
Members (id, username, global_name)
Output Format
JSON (Default)
All commands output JSON by default for AI consumption:
{
"id"
:
"1234567890123456789"
,
"content"
:
"Hello world"
,
"author"
:
"bot-username"
,
"timestamp"
:
"2024-01-15T10:30:00.000Z"
}
Pretty (Human-Readable)
Use
--pretty
flag for formatted output:
agent-discordbot channel list
--pretty
Global Options
Option
Description
--pretty
Human-readable output instead of JSON
--bot