Loading...
Loading...
Interact with Discord servers using bot tokens - send messages, read channels, manage reactions
npx skill4agent add devxoul/agent-messenger agent-discordbotserver switch <id>--server <id>MessageContentGuildMembersGuildPresences#channel-name# 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# 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~/.config/agent-messenger/MEMORY.mdReadWrite~/.config/agent-messenger/MEMORY.mdRead~/.config/agent-messenger/MEMORY.mdWriteserver listchannel listuser listauth listWriteMEMORY.md# 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 monitoringMemory lets you skip repeatedandchannel listcalls. When you already know an ID from a previous session, use it directly.server list
# 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># Show current authenticated bot
agent-discordbot whoami
agent-discordbot whoami --pretty
agent-discordbot whoami --bot <bot-id># 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># 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# List channels in current server
agent-discordbot channel list
# Get channel info
agent-discordbot channel info <channel-id>
agent-discordbot channel info 1234567890123456789# List server members
agent-discordbot user list
agent-discordbot user list --limit 50
# Get user info
agent-discordbot user info <user-id># 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># 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># 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># Brief snapshot (default) — fast, minimal API calls
agent-discordbot snapshot
# Full snapshot — includes messages and members (slow, large output)
agent-discordbot snapshot --full
# Filtered full snapshots
agent-discordbot snapshot --full --channels-only
agent-discordbot snapshot --full --users-only
# Limit messages per channel (only with --full)
agent-discordbot snapshot --full --limit 10--full{
"id": "1234567890123456789",
"content": "Hello world",
"author": "bot-username",
"timestamp": "2024-01-15T10:30:00.000Z"
}--prettyagent-discordbot channel list --pretty| Option | Description |
|---|---|
| Human-readable output instead of JSON |
| Use a specific bot for this command |
| Use a specific server for this command |
references/common-patterns.mdtemplates/post-message.shmonitor-channel.shserver-summary.sh{
"error": "No credentials. Run \"auth set\" first."
}missing_tokeninvalid_tokenMissing AccessUnknown ChannelMissing Permissions~/.config/agent-messenger/discordbot-credentials.json| Feature | agent-discord | agent-discordbot |
|---|---|---|
| Token type | User token | Bot token |
| Token source | Auto-extracted from desktop app | Manual from Developer Portal |
| Message search | Yes | No |
| DMs | Yes | No |
| Mentions | Yes | No |
| Friends/Notes | Yes | No |
| Edit/delete messages | Any message | Bot's own messages only |
| File upload | Yes | Yes |
| Snapshot | Yes | Yes |
| CI/CD friendly | Requires desktop app | Yes (just set token) |
import { DiscordBotListener } from 'agent-messenger/discordbot'agent-discordbot: command not foundagent-discordbotagent-messengeragent-discordbotagent-discordbot message send 1234567890123456789 "Hello"npx -ynpx -y agent-messenger discordbot message send 1234567890123456789 "Hello"
bunx agent-messenger discordbot message send 1234567890123456789 "Hello"
pnpm dlx agent-messenger discordbot message send 1234567890123456789 "Hello"If you already know the user's preferred package runner (e.g.,,bunx), use that instead.pnpm dlx
npx agent-discordbotbunx agent-discordbotpnpm dlx agent-discordbotagent-discordbot