Agent MessengerAgent Messenger
Platform Guides

Discord

Complete reference for the agent-discord CLI.

Tip: agent-discord is a shortcut for agent-messenger discord.

Quick Start

# 1. Extract credentials from Discord desktop app or browser (zero-config!)
agent-discord auth extract

# 2. Get server snapshot
agent-discord snapshot

# 3. Send a message
agent-discord message send <channel-id> "Hello from AI agent!"

Authentication

Seamless Token Extraction

agent-discord automatically extracts your Discord credentials from the desktop app or Chromium browser:

agent-discord auth extract

# Use --debug for troubleshooting
agent-discord auth extract --debug

# Scan custom Chromium profile/user-data dirs (repeatable or comma-separated)
agent-discord auth extract --browser-profile ~/browser-data
agent-discord auth extract --browser-profile ~/work-profile --browser-profile ~/personal-profile

This command:

  • Auto-detects your platform (macOS/Linux/Windows)
  • Extracts Discord user token from the desktop app (with browser fallback)
  • Validates token against Discord API
  • Discovers ALL joined servers
  • Stores credentials securely in ~/.config/agent-messenger/
  • Supports --browser-profile <path> for agent-browser profiles, custom Chrome user data dirs, or portable browser profiles

Authentication Commands

# Check auth status
agent-discord auth status

# Logout (clear stored credentials)
agent-discord auth logout

Server Management

You must select a server before using most commands.

# List all servers
agent-discord server list

# Switch to a different server
agent-discord server switch <server-id>

# Show current server
agent-discord server current

# Get server info
agent-discord server info <server-id>

Commands

Whoami Command

# Show current authenticated user
agent-discord whoami
agent-discord whoami --pretty

Output includes the authenticated user's identity information.

Message Commands

# Send a message
agent-discord message send <channel-id> <content>
agent-discord message send 123456789 "Hello world"

# List messages
agent-discord message list <channel-id>
agent-discord message list 123456789 --limit 50

# Get a specific message
agent-discord message get <channel-id> <message-id>

# Delete a message
agent-discord message delete <channel-id> <message-id> --force

# Search messages in current server
agent-discord message search <query>
agent-discord message search "bug fix"

# Search with filters
agent-discord message search "meeting" --channel 123456789
agent-discord message search "report" --author 987654321
agent-discord message search "screenshot" --has image

# Search with sorting and pagination
agent-discord message search "hello" --sort timestamp --sort-dir desc
agent-discord message search "test" --limit 10 --offset 20

Search Options:

  • --channel <id> - Filter by specific channel
  • --author <id> - Filter by specific author
  • --has <type> - Filter by attachment type: file, image, video, embed, link, sticker
  • --sort <type> - Sort by: timestamp (default), relevance
  • --sort-dir <dir> - Sort direction: asc, desc (default)
  • --limit <n> - Number of results (max 25, default 25)
  • --offset <n> - Pagination offset (default 0)

Note: Search requires a current server to be set. Use agent-discord server switch <server-id> first.

Channel Commands

# List channels in current server
agent-discord channel list

# Get channel info
agent-discord channel info <channel-id>

# Get channel message history
agent-discord channel history <channel-id>
agent-discord channel history 123456789 --limit 100

User Commands

# List server members
agent-discord user list

# Get user info
agent-discord user info <user-id>

# Get current authenticated user
agent-discord user me

Reaction Commands

# Add reaction
agent-discord reaction add <channel-id> <message-id> <emoji>
agent-discord reaction add 123456789 987654321 thumbsup

# Remove reaction
agent-discord reaction remove <channel-id> <message-id> <emoji>

# List reactions on a message
agent-discord reaction list <channel-id> <message-id>

File Commands

# Upload file to channel
agent-discord file upload <channel-id> <path>
agent-discord file upload 123456789 ./report.pdf

# List files in channel
agent-discord file list <channel-id>

# Get file info
agent-discord file info <channel-id> <file-id>

Snapshot Command

Get server overview for AI agents (brief by default):

# Brief snapshot (default) — fast, minimal API calls
agent-discord snapshot

# Full snapshot — includes messages and members (slow, large output)
agent-discord snapshot --full

# Filtered full snapshots
agent-discord snapshot --full --channels-only
agent-discord snapshot --full --users-only

# Limit messages per channel (only with --full)
agent-discord snapshot --full --limit 10

Default returns brief JSON with:

  • Server metadata (id, name)
  • Channels (id, name) — text channels only
  • Hint for next commands

With --full, returns comprehensive JSON with:

  • Server metadata (id, name)
  • Channels (id, name, type, topic)
  • Recent messages (id, content, author, timestamp)
  • Members (id, username, global_name)

DM Commands

# List DM channels
agent-discord dm list

# Create a DM channel with a user
agent-discord dm create <user-id>

Thread Commands

# Create a thread in a channel
agent-discord thread create <channel-id> <name>
agent-discord thread create 123456789 "Bug Discussion" --auto-archive-duration 1440

# Archive a thread
agent-discord thread archive <thread-id>

Mention Commands

# List recent mentions
agent-discord mention list
agent-discord mention list --limit 10

# Filter by guild
agent-discord mention list --guild <guild-id>

Member Commands

# Search guild members
agent-discord member search <guild-id> <query>
agent-discord member search 123456789 "john" --limit 20

Friend Commands

# List friends and relationships
agent-discord friend list

Profile Commands

# Get a user's profile
agent-discord profile get <user-id>

Note Commands

# Get your note on a user
agent-discord note get <user-id>

# Set a note on a user
agent-discord note set <user-id> "Met at conference"

Global Options

All commands support these options:

--pretty    # Pretty-print JSON output (default is compact JSON)
--server <id>  # Use specific server (overrides current server)

Key Differences from Slack

ConceptSlackDiscord
ServerWorkspaceServer
Channel IDAlphanumeric (C01234567)Numeric snowflake (123456789012345678)
Message IDTimestamp (1234567890.123456)Numeric snowflake (123456789012345678)
User IDAlphanumeric (U01234567)Numeric snowflake (123456789012345678)
ThreadsThread timestampsThread channels

AI Agent Integration

See skills/agent-discord/ for:

  • Complete skill documentation
  • Runnable templates

On this page