Multi-platform messaging plugin that gives Claude Code CLI access to Discord and eleven other chat services.

CCM score
57 of 100
version
1.15.0
GitHub stars
258

Own this plugin? Claim it

What it does

  • Adds agent-discord and agent-discordbot skills for sending messages, reading channels, and managing reactions on Discord
  • Covers the same send, read, and react workflow across Slack, Teams, Telegram, WhatsApp, LINE, and other platforms
  • Uses extracted desktop app or browser credentials for personal accounts, and bot tokens for bot-based access
  • Designed for agents that need to message as you on Discord without setting up a bot or waiting on admin approval

Interact with Discord servers through a CLI interface. Features seamless token extraction from Discord desktop app, multi-guild support, message operations, channel management, reactions, and file uploads.

Add marketplace

/plugin marketplace add agent-messenger/agent-messenger

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install agent-discord@agent-messenger

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Agent Channel

A TypeScript CLI tool that enables AI agents and humans to interact with Channel Talk workspaces through a simple command interface. Features zero-config credential extraction from the Channel Talk desktop app (with browser fallback) and multi-workspace support.

Key Concepts

Before diving in, a few things about Channel Talk's terminology:

  • Channel = workspace (not a chat channel like Slack). The API calls it a "channel," but it means your entire workspace.
  • UserChats = 1:1 conversations with end users (customers).
  • Groups = team inbox channels (similar to Slack channels). Referenced by ID.
  • DirectChats = direct messages between managers.
  • Managers = human agents on your team.
  • Bots = automated agents in the workspace.
  • Messages use a blocks format: [{ type: "text", value: "..." }]. The CLI handles this automatically when you pass plain text.

Quick Start

# Get workspace snapshot (credentials are extracted automatically)
agent-channeltalk snapshot --pretty

# Send a message to a group
agent-channeltalk message send group grp_abc123 "Hello from the CLI!"

# Send a message to a user chat
agent-channeltalk message send user-chat uc_abc123 "Thanks for reaching out!"

# List user chats
agent-channeltalk chat list

Authentication

Credentials are extracted automatically from the Channel Talk desktop app (or Chromium browser as fallback) on first use. No manual setup required, no API keys needed. Just run any command and authentication happens silently in the background.

The Channel Talk desktop app stores auth cookies in a SQLite database. On macOS, cookies are plaintext and no Keychain prompt is needed. On Windows, cookies are DPAPI-encrypted and decrypted automatically. When falling back to a Chromium browser on macOS, cookies require Keychain decryption. The CLI reads two cookies:

  • x-account (JWT) - your account identity
  • ch-session-1 (JWT) - your session token

These cookies expire after roughly 30 days. When they expire, the CLI automatically re-extracts fresh cookies from the desktop app or browser on the next command.

IMPORTANT: Always use agent-channeltalk auth extract to obtain credentials. The CLI extracts from the desktop app first, falling back to Chromium browsers if the app isn't installed.

Multi-Workspace Support

If you're logged into multiple Channel Talk workspaces, all are discovered automatically. The first workspace is selected by default.

# List all available workspaces
agent-channeltalk auth list

# Switch to a different workspace
agent-channeltalk auth use <workspace-id>

# Check auth status
agent-channeltalk auth status

# Remove a stored workspace
agent-channeltalk auth remove <workspace-id>

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 workspace IDs, group IDs, chat IDs, manager 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 workspace IDs and names (from auth list, snapshot, etc.)
  • After discovering group IDs and names (from group list, snapshot, etc.)
  • After discovering chat IDs (from chat list, etc.)
  • After discovering manager IDs and names (from manager list, etc.)
  • After discovering bot names (from bot list, etc.)
  • After the user gives you an alias or preference ("call this the support workspace", "my main group is X")

When writing, include the complete file content. The Write tool overwrites the entire file.

What to Store

  • Workspace IDs with names
  • Group IDs with names
  • UserChat IDs with context
  • Manager IDs with names
  • Bot IDs with names
  • User-given aliases ("support workspace", "billing group")
  • Any user preference expressed during interaction

What NOT to Store

Never store cookies, tokens, credentials, or any sensitive data. Never store full message content (just IDs and context). Never store personal user data.

Handling Stale Data

If a memorized ID returns an error (chat not found, group 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

## Channel Talk Workspaces

- `abc123` - Acme Support

## Groups (Acme Support)

- `grp_111` - Support Inbox
- `grp_222` - Billing Inbox
- `grp_333` - Engineering

## Recent UserChats (Acme Support)

- `uc_aaa` - John Doe inquiry (opened)
- `uc_bbb` - Refund request (closed)

## Managers (Acme Support)

- `mgr_001` - Alice (Team Lead)
- `mgr_002` - Bob (Support Agent)

## Bots (Acme Support)

- `bot_001` - Support Bot
- `bot_002` - Notification Bot

## Aliases

- "support" -> `grp_111` (Support Inbox in Acme Support)

## Notes

- User prefers --pretty output for snapshots
- Main workspace is "Acme Support"

Memory lets you skip repeated group list and chat list calls. When you already know an ID from a previous session, use it directly.

Commands

Auth Commands

# Extract cookies from Channel Talk desktop app or browser (usually automatic)
agent-channeltalk auth extract
agent-channeltalk auth extract --browser-profile ~/browser-data
agent-channeltalk auth extract --browser-profile "$HOME/work-profile,$HOME/personal-profile"

# --browser-profile accepts repeatable or comma-separated Chromium profile/user-data dirs

# Check auth status
agent-channeltalk auth status
agent-channeltalk auth status --workspace <id>

# Clear all stored credentials
agent-channeltalk auth clear

# List all stored workspaces
agent-channeltalk auth list

# Switch active workspace
agent-channeltalk auth use <workspace-id>

# Remove a stored workspace
agent-channeltalk auth remove <workspace-id>

Whoami Command

# Show current authenticated user
agent-channeltalk whoami
agent-channeltalk whoami --pretty
agent-channeltalk whoami --workspace <workspace-id>

Output includes the authenticated user's identity information.

Message Commands

# Send a message (chat-type: group, user-chat, or direct-chat)
agent-channeltalk message send <chat-type> <chat-id> <text>
agent-channeltalk message send group grp_abc123 "Hello team!"
agent-channeltalk message send user-chat uc_abc123 "Thanks for reaching out!"
agent-channeltalk message send direct-chat dc_abc123 "Quick question..."

# List messages from a group, user chat, or direct chat
agent-channeltalk message list <chat-type> <chat-id>
agent-channeltalk message list group grp_abc123 --limit 50
agent-channeltalk message list user-chat uc_abc123 --sort asc

# Get a specific message by ID
agent-channeltalk message get <chat-type> <chat-id> <message-id>

# Search messages across team chats or user chats
agent-channeltalk message search <query>
agent-channeltalk message search "deployment" --scope team-chat
agent-channeltalk message search "refund" --scope user-chat --limit 10

Chat Commands (UserChats)

# List user chats assigned to me (default: opened)
agent-channeltalk chat list
agent-channeltalk chat list --state opened
agent-channeltalk chat list --state snoozed
agent-channeltalk chat list --state closed
agent-channeltalk chat list --limit 50

# Get a specific user chat
agent-channeltalk chat get <chat-id>

Group Commands

# List groups
agent-channeltalk group list
agent-channeltalk group list --limit 50

# Get a group by ID
agent-channeltalk group get <group-id>

# Get messages from a group
agent-channeltalk group messages <group-id>
agent-channeltalk group messages grp_abc123 --limit 50 --sort asc

Manager Commands

# List all managers
agent-channeltalk manager list
agent-channeltalk manager list --limit 50

Bot Commands

# List all bots
agent-channeltalk bot list
agent-channeltalk bot list --limit 50

Snapshot Command

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

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

# Full snapshot — includes messages, managers, bots (slow, large output)
agent-channeltalk snapshot --full

# Filtered full snapshots
agent-channeltalk snapshot --full --groups-only
agent-channeltalk snapshot --full --chats-only

# Limit messages per group/chat (only with --full)
agent-channeltalk snapshot --full --limit 10

Default returns brief JSON with:

  • Workspace metadata (id, name)
  • Groups (id, name)
  • UserChat summary (total count, by state)
  • Hint for next commands

With --full, returns comprehensive JSON with:

  • Workspace metadata (id, name)
  • Groups with recent messages (id, name, messages)
  • UserChat summary (total count, by state, recent opened)
  • Managers (id, name, email)
  • Bots (id, name)

Output Format

JSON (Default)

All commands output JSON by default for AI consumption:

{
  "id": "msg_abc123",
  "channel_id": "ch_def456",
  "chat_id": "uc_ghi789",
  "chat_type": "user-chat",
  "person_type": "manager",
  "plain_text": "Hello world",
  "created_at": 1705312200000
}

Pretty (Human-Readable)

Use --pretty flag for formatted output:

agent-channeltalk group list --pretty

Global Options

OptionDescription
--prettyHuman-readable output instead of JSON
--workspace <id>Use a specific workspace for this command

Common Patterns

See references/common-patterns.md for typical AI agent workflows.

Templates

See templates/ directory for runnable examples:

  • post-message.sh - Send messages with error handling
  • monitor-chat.sh - Poll for new UserChats
  • workspace-summary.sh - Generate workspace summary

Error Handling

All commands return consistent error format:

{
  "error": "No credentials. Run \"agent-channeltalk auth extract\" first."
}

Common errors: No credentials, Workspace not found, Invalid --limit value.

Configuration

Credentials stored in ~/.config/agent-messenger/channel-credentials.json (0600 permissions). See references/authentication.md for format and security details.

Config format:

{
  "current": { "workspace_id": "abc123" },
  "workspaces": {
    "abc123": {
      "workspace_id": "abc123",
      "workspace_name": "Acme Support",
      "account_id": "acc_001",
      "account_name": "Alice",
      "account_cookie": "...",
      "session_cookie": "..."
    }
  }
}

Feature Comparison: agent-channeltalk vs agent-channeltalkbot

Featureagent-channeltalk (user)agent-channeltalkbot (bot)
Auth methodAuto-extract cookiesAPI key + secret
Setup requiredNone (zero-config)Manual key setup
Acts asYou (manager)Bot identity
Send messages✅✅
List messages✅✅
Search messages✅-
Close/delete chats-✅
Create/delete bots-✅
Set default bot-✅
Group @name references-✅
Direct chat support✅-
Multi-workspace✅✅
CI/CD friendly-✅

Use agent-channeltalk when you want zero-config access acting as yourself. Use agent-channeltalkbot for server-side automation, CI/CD pipelines, or when you need bot-specific features like closing chats.

Limitations

  • Desktop app extraction: macOS and Windows. Browser fallback: macOS, Linux, and Windows.
  • No real-time events / WebSocket connection
  • No file upload support
  • No message editing or deletion
  • No chat close/delete (use agent-channeltalkbot for chat management)
  • No bot creation/deletion (use agent-channeltalkbot for bot management)
  • No @name group references (use group IDs from group list)
  • Plain text messages only (no rich blocks in v1)
  • Cookies expire after ~30 days (auto-re-extracted)

Troubleshooting

agent-channeltalk: command not found

agent-channeltalk is NOT the npm package name. The npm package is agent-messenger.

If the package is installed globally, use agent-channeltalk directly:

agent-channeltalk snapshot --pretty

If the package is NOT installed, run it directly with npx -y:

npx -y agent-messenger channeltalk snapshot --pretty

Note: If the user prefers a different package runner (e.g., bunx, pnpx, pnpm dlx), use that instead.

NEVER run npx agent-channeltalk, bunx agent-channeltalk, or pnpm dlx agent-channeltalk. It will fail or install a wrong package since agent-channeltalk is not the npm package name.

Channel Talk desktop app not found

The CLI looks for the desktop app's cookie database in these locations. The app was rebranded from Channel Talk to Channel Works, so both names are probed, Channel Works first.

macOS:

  1. ~/Library/Containers/com.zoyi.channel.desk.osx/Data/Library/Application Support/{Channel Works,Channel Talk}/Cookies (Mac App Store version)
  2. ~/Library/Application Support/{Channel Works,Channel Talk}/Cookies (direct download / Electron version)

Windows:

  1. %APPDATA%\{Channel Works,Channel Talk}\Network\Cookies

If none exist, log in to Channel Talk in a supported Chromium browser (Chrome, Edge, Arc, Brave) or install the desktop app and log in.

Cookies expired

Cookies expire after roughly 30 days. The CLI automatically re-extracts on the next command. If auto-extraction fails:

  1. Open the Channel Talk desktop app or desk.channel.io in a supported Chromium browser
  2. Make sure you're logged in
  3. Run agent-channeltalk auth extract

For other troubleshooting, see references/authentication.md.

References

From the agent-messenger/agent-messenger README

Agent Messenger

npm platform platform platform platform platform platform platform platform platform platform platform platform

Your agent messages as you — not as a bot

One CLI for Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, WeChat, iMessage, Instagram, KakaoTalk, and Channel Talk. Credentials extracted from desktop apps and browsers, or authenticated in seconds — no API keys, no OAuth, no admin approval. TypeScript SDK included.

[!TIP] 🎉 Agent Messenger powers multi-channel messaging in TypeClaw, a TypeScript-native agent runtime.

Table of Contents

Why Agent Messenger?

You shouldn't need a bot token to send a message.

Every platform gates API access behind OAuth apps that need admin approval — days of waiting just to send a message. And even then, your agent is a bot, not you. Different name, different permissions, different context.

Agent Messenger reads session tokens from your Slack, Discord, Teams, KakaoTalk, or Channel Talk desktop app — zero config. If the desktop app isn't installed, it falls back to extracting from Chromium browsers, with auth extract --browser-profile <path> for custom Chromium profile locations. Webex and Instagram tokens are extracted directly from browsers. Telegram authenticates with a one-time phone code, and WhatsApp with a QR code or pairing code. Either way, your agent operates as you — same name, same permissions, same context. Bot tokens are fully supported too for server-side and CI/CD use cases.

[!TIP] For Slack and Discord, QR code sign-in (auth qr) is the recommended way to authenticate — it's the safest and most reliable method. It signs you in through the platform's own login flow instead of reading credentials off disk, and works even without the desktop app. See the Slack and Discord auth guides.

  • QR Code Sign-In (Slack & Discord) — The recommended, safest auth: sign in through the platform's official flow, no credential extraction and no desktop app required (Discord scans with the mobile app)
  • Auto-Extract Auth — Reads tokens from Slack, Discord, Teams, KakaoTalk, and Channel Talk desktop apps, with browser fallback and custom Chromium profile paths via --browser-profile. Webex and Instagram tokens extracted from Chromium browsers. Telegram and WhatsApp authenticate with a one-time code — still under a minute
  • Act As Yourself — Extracts your user session — not a bot token. Your agent sends messages, reacts, and searches as you. Need bot mode? Bot CLIs are included too
  • One Interface — Consistent command style across 12 platforms for supported actions (e.g. message send, message search, channel list, snapshot). Learn once
  • Agent-Native Output — JSON by default for LLM tool use. --pretty for human-readable. Structured output your agent can parse and act on
  • Token Efficient — CLI, not MCP. One skill file, one shell command per action. No server to run, no tool registration. (Why not MCP?)
  • Persistent Memory — Stores workspace IDs, channel mappings, and preferences in ~/.config so your agent never asks twice
  • TypeScript SDK — Import clients directly into your app. Full type safety with Zod schemas

Installation

CLI (global install for terminal / AI agent use):

npm install -g agent-messenger

SDK (project dependency for programmatic use):

npm install agent-messenger

The global install gives you all platform CLIs. The project install gives you both CLIs and the TypeScript SDK.

This installs:

  • agent-slack — Slack CLI (user token, zero-config, or QR code sign-in)
  • agent-slackbot — Slack Bot CLI (bot token, for server-side/CI/CD)
  • agent-discord — Discord CLI (token extraction, or QR code sign-in via the mobile app)
  • agent-discordbot — Discord Bot CLI (bot token, for server-side/CI/CD)
  • agent-teams — Microsoft Teams CLI
  • agent-webex — Cisco Webex CLI (browser token extraction with e2e encryption + OAuth Device Grant, zero-config)
  • agent-webexbot — Webex Bot CLI (bot token, for server-side/CI/CD with real-time Mercury WebSocket listener)
  • agent-telegram — Telegram CLI (user account via TDLib)
  • agent-telegrambot — Telegram Bot CLI (bot token, for server-side/CI/CD)
  • agent-whatsapp — WhatsApp CLI (user account via Baileys, QR code or pairing code auth)
  • agent-whatsappbot — WhatsApp Bot CLI (Cloud API, for server-side/CI/CD)
  • agent-line — LINE CLI (QR code login, Thrift protocol)
  • agent-wechatbot — WeChat Bot CLI (Official Account API, for server-side/CI/CD)
  • agent-imessage — iMessage CLI (runs on a Mac via the imsg tool)
  • agent-instagram — Instagram DM CLI (browser cookie extraction + username/password auth)
  • agent-kakaotalk — KakaoTalk CLI (sub-device login, LOCO protocol)
  • agent-channeltalk — Channel Talk CLI (beta, zero-config, extracted cookies)
  • agent-channeltalkbot — Channel Talk Bot CLI (beta, API credentials, for server-side/CI/CD)

Agent Skills

Agent Messenger includes Agent Skills for the common messaging workflow and each platform CLI. Start with agent-messenger, then load only the platform skills you need.

For AI agents

When asked to use Agent Messenger, install and read its entry skill before performing messaging operations. If the skill is already installed, read that copy instead of reinstalling it:

npx -y skills add agent-messenger/agent-messenger --skill agent-messenger --yes

Run this from the current project for project-local installation. To target a specific supported agent, append its selector, for example --agent codex. Do not use --global unless the user requests a global installation. Follow the installer's reported path and read SKILL.md; do not assume every harness stores skills in the same directory.

The entry skill guides you to the correct platform and user/bot identity, then explains how to install the corresponding platform skill. It also covers recipient and thread resolution, delivery receipts, uncertain sends, and reply follow-ups. Install the CLI separately using Installation if it is missing.

Skill installation is not authentication or permission to send messages, switch accounts, extract credentials, or start listeners. Preserve the user's requested identity and the host's approval rules. These are instructions for an agent reading this README, not an executable README hook.

SkillPad

SkillPad is a GUI app for Agent Skills. See skillpad.dev for more details.

Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad Available on SkillPad

Skills CLI

Skills CLI is a CLI tool for Agent Skills. See skills.sh for more details.

npx -y skills add agent-messenger/agent-messenger

Claude Code Plugin

claude plugin marketplace add agent-messenger/agent-messenger
claude plugin install agent-messenger

Or within Claude Code:

/plugin marketplace add agent-messenger/agent-messenger
/plugin install agent-messenger

Quick Start

Get up and running in 30 seconds:

# 1. See your workspace at a glance
agent-slack snapshot --pretty

# 2. Send a message
agent-slack message send general "Hello from the CLI!"

That's it. Credentials are extracted automatically from your Slack desktop app on first run. No OAuth flows. No API tokens. No configuration files.

No desktop app? QR code sign-in is the recommended way to authenticate Slack and Discord. In Slack, open "Sign in on mobile", copy the QR image, and pipe it in; in Discord, scan the printed QR with the mobile app:

pbpaste | agent-slack auth qr   # paste Slack's "Sign in on mobile" QR
agent-discord auth qr           # scan the printed QR with the Discord app

Custom config directory

By default, Agent Messenger stores credentials, sync state, and derived-key caches under ~/.config/agent-messenger. To relocate everything (e.g. for CI sandboxes, multi-tenant setups, or non-default home directories), set the AGENT_MESSENGER_CONFIG_DIR environment variable:

export AGENT_MESSENGER_CONFIG_DIR="$HOME/.local/share/agent-messenger"
agent-slack auth extract

The variable is read on every CLI/SDK invocation and applies to all platforms (Slack, Discord, Teams, Webex, Telegram, WhatsApp, LINE, WeChat, iMessage, Instagram, KakaoTalk, Channel Talk, and their bot variants). Explicit configDir arguments to credential managers still take precedence.

Telegram Quick Start

Get up and running with Telegram in a minute:

bunx --package agent-messenger agent-telegram auth login

# Send a message
bunx --package agent-messenger agent-telegram message send <chat-id-or-@username> "Hello from the CLI!"

The CLI automatically provisions API credentials via my.telegram.org if needed. For CI/CD, set AGENT_TELEGRAM_API_ID and AGENT_TELEGRAM_API_HASH environment variables.

SDK

Use Agent Messenger as a TypeScript library. Each platform exports a typed client, credential manager, types, and Zod schemas.

Quick Example

import { SlackClient } from 'agent-messenger/slack'

const slack = await new SlackClient().login()
const channels = await slack.listChannels()
await slack.sendMessage(channels[0].id, 'Hello from the SDK!')

Credentials are resolved the same way as the CLI — auto-extracted from your desktop apps. Call .login() with no arguments for auto-extraction, or pass credentials explicitly:

const slack = await new SlackClient().login({ token: 'xoxc-...', cookie: 'xoxd-...' })

Available Imports

Import PathClient
agent-messenger/slackSlackClient
agent-messenger/slackbotSlackBotClient
agent-messenger/discordDiscordClient
agent-messenger/discordbotDiscordBotClient
agent-messenger/teamsTeamsClient
agent-messenger/webexWebexClient
agent-messenger/webexbotWebexBotClient
agent-messenger/telegrambotTelegramBotClient
agent-messenger/whatsappWhatsAppClient
agent-messenger/whatsappbotWhatsAppBotClient
agent-messenger/lineLineClient
agent-messenger/wechatbotWeChatBotClient
agent-messenger/imessageImsgClient
agent-messenger/instagramInstagramClient
agent-messenger/kakaotalkKakaoTalkClient
agent-messenger/channeltalkChannelClient
agent-messenger/channeltalkbotChannelBotClient

Each module also exports its credential manager, Zod schemas, and TypeScript types (except imessage, which exports its client, credential manager, and TypeScript types — no Zod schemas):

import { SlackClient, SlackCredentialManager, SlackMessageSchema } from 'agent-messenger/slack'
import type { SlackMessage, SlackChannel } from 'agent-messenger/slack'

Manual Credential Setup

Every client supports .login() with explicit credentials for advanced use cases:

import { SlackClient } from 'agent-messenger/slack'

const client = await new SlackClient().login({ token: 'xoxc-...', cookie: 'xoxd-...' })
const messages = await client.getMessages('C01234567')

Editing Messages

Clients that support message editing expose an editMessage method (matching each platform's API, Slack/SlackBot use updateMessage and TelegramBot uses editMessageText). You can only edit your own messages, subject to each platform's edit window.

import { DiscordClient } from 'agent-messenger/discord'

const discord = await new DiscordClient().login()
const msg = await discord.sendMessage(channelId, 'Deploying…')
await discord.editMessage(channelId, msg.id, 'Deployed ✅')

Unread Mentions (Discord)

getUnreadMentions returns only the mentions behind Discord's unread-mention badge by correlating your recent mention history (Discord's 7-day window) with per-channel read state. count is the enumerated unread mentions, badgeCount is Discord's account-wide badge total, and complete is true when the scan exhausted all available mention history and false when it stopped early due to the limit or a non-advancing cursor.

import { DiscordClient } from 'agent-messenger/discord'

const discord = await new DiscordClient().login()
const { mentions, count, badgeCount, complete } = await discord.getUnreadMentions()

Unread DMs (Discord)

Mention history only records server mentions, so DMs never appear in getUnreadMentions. getUnreadDMs covers them by comparing each DM and group-DM channel's last_message_id against its read marker. Each channel's unreadCount is Discord's own badge counter — null when the channel has no read-state entry (count unknown, still reported as unread) and 0 when the DM is muted. count and totalUnread describe every unread DM found, so they stay accurate when limit caps the returned list. complete is false when Discord delivered a partial read state, in which case never-opened DMs may be missing from the result.

import { DiscordClient } from 'agent-messenger/discord'

const discord = await new DiscordClient().login()
const { channels, count, totalUnread, complete } = await discord.getUnreadDMs()

QR Code Login (Slack)

Sign in with a QR code from Slack's "Sign in on mobile" screen — no desktop app or browser automation, just HTTP. dataUrl is the QR image as a data:image/png;base64,... string.

import { loginWithQr, SlackClient } from 'agent-messenger/slack'

const session = await loginWithQr(dataUrl)
const client = await new SlackClient().login({ token: session.token, cookie: session.cookie })

QR Code Login (Discord)

Sign in by scanning a QR code with the Discord mobile app — no desktop app or browser token extraction required. loginWithRemoteAuth runs Discord's Remote Auth protocol and hands you a QR URL to display; once the user scans and confirms on their phone, you receive the user token.

import { DiscordClient, loginWithRemoteAuth } from 'agent-messenger/discord'

const session = await loginWithRemoteAuth({
  onQrUrl: (url) => {
    // Render this URL as a QR code (e.g. with the `qrcode` package)
    console.log('Scan this with the Discord mobile app:', url)
  },
})
const client = await new DiscordClient().login({ token: session.token })

Real-time Events (Slack)

import { SlackClient, SlackListener } from 'agent-messenger/slack'

const client = await new SlackClient().login()
const listener = new SlackListener(client)
listener.on('message', (event) => {
  console.log(`New message in ${event.channel}: ${event.text}`)
})
await listener.start()

Real-time Events (Webex)

Stream Webex messages, memberships, attachment actions, and room events over Mercury WebSocket.

import { WebexClient, WebexListener } from 'agent-messenger/webex'

const client = await new WebexClient().login()
const listener = new WebexListener(client)

listener.on('message_created', (event) => {
  console.log(`New message in ${event.roomId}: ${event.text}`)
})

listener.on('membership_created', (event) => {
  console.log(`Membership changed in ${event.roomId}: ${event.personId}`)
})

await listener.start()

Real-time Events (Teams)

Stream Teams chat messages in real time over Teams' internal trouter WebSocket — as a user, with no bot registration and no public HTTP endpoint. Requires the Teams desktop app to be logged in (the listener reuses your extracted session credentials).

import { TeamsClient, TeamsListener } from 'agent-messenger/teams'

const client = await new TeamsClient().login()
const listener = new TeamsListener(client)

listener.on('message', async (message) => {
  console.log(`New message in ${message.chatId}: ${message.content}`)

  // Channel messages carry team/channel context and parsed @mentions, so you
  // can reply into the channel or act on who was mentioned.
  if (message.conversationType === 'channel') {
    for (const mention of message.mentions) {
      console.log(`Mentioned: ${mention.displayName} (${mention.mri})`)
    }
    await client.sendMessage(message.teamId!, message.channelId!, 'On it 👍')
  }
})

await listener.start()

Each message is a TeamsRealtimeMessage: conversationType is 'chat' or 'channel', teamId/channelId are set for channel messages, and mentions is always present (empty for messages with no @mentions).

Real-time Events (KakaoTalk)

import { KakaoTalkClient, KakaoTalkListener } from 'agent-messenger/kakaotalk'

const client = await new KakaoTalkClient().login()
const listener = new KakaoTalkListener(client)
listener.on('message', (event) => {
  console.log(`New message in ${event.chat_id}: ${event.message}`)
})
listener.on('emoticon', (event) => {
  console.log(`Sticker (${event.emoticon_kind}) in ${event.chat_id}: ${event.sticker_path}`)
})
await listener.start()

Real-time Events (Discord Bot)

Stream messages, reactions, and slash command interactions directly from Discord's Gateway WebSocket — no public HTTP endpoint required.

import { DiscordBotClient, DiscordBotListener, DiscordIntent } from 'agent-messenger/discordbot'

const client = await new DiscordBotClient().login({ token: 'YOUR_BOT_TOKEN' })
const listener = new DiscordBotListener(client, {
  // Privileged intents (MessageContent, GuildMembers, GuildPresences) must be enabled
  // in the Discord Developer Portal before they can be used.
  intents: DiscordIntent.Guilds | DiscordIntent.GuildMessages | DiscordIntent.MessageContent,
})

listener.on('message_create', (event) => {
  console.log(`New message in ${event.channel_id}: ${event.content}`)
})

listener.on('interaction_create', (event) => {
  const name = (event.data as { name?: string } | undefined)?.name
  console.log(`Slash command received: ${name}`)
})

await listener.start()

Real-time Events (Telegram Bot)

Stream messages, callback queries, and other updates via long-polling — no public HTTPS endpoint required. Telegram Bot API does not support WebSockets, so the listener uses getUpdates long-polling, which is the canonical approach used by frameworks like grammy and telegraf.

import { TelegramBotClient, TelegramBotListener } from 'agent-messenger/telegrambot'

const client = await new TelegramBotClient().login({ token: 'YOUR_BOT_TOKEN' })
const listener = new TelegramBotListener(client, {
  allowedUpdates: ['message', 'callback_query'],
})

listener.on('message', (message) => {
  console.log(`New message in ${message.chat.id}: ${message.text}`)
})

listener.on('callback_query', (query) => {
  console.log(`Button clicked: ${query.data}`)
})

await listener.start()

Real-time Events (Slack Bot)

Stream Events API events, slash commands, and interactive components over Slack's Socket Mode WebSocket — no public HTTP endpoint required. Requires an app-level token (xapp-...) with the connections:write scope, separate from your bot token.

import { SlackBotClient, SlackBotListener } from 'agent-messenger/slackbot'

const client = await new SlackBotClient().login({ token: 'xoxb-...' })
const listener = new SlackBotListener(client, {
  appToken: process.env.SLACK_APP_TOKEN!, // xapp-...
})

listener.on('message', ({ ack, event }) => {
  ack()
  console.log(`New message in ${event.channel}: ${event.text}`)
})

listener.on('slash_commands', ({ ack, body }) => {
  ack({ text: `Got \`${body.command} ${body.text}\`` })
})

await listener.start()

Real-time Events (Instagram)

Stream Instagram DMs in real time over Instagram's MQTToT transport (a persistent TLS connection to edge-mqtt.facebook.com), with automatic fallback to polling if the connection can't be established.

import { InstagramClient, InstagramHybridListener } from 'agent-messenger/instagram'

const client = await new InstagramClient().login()
const listener = new InstagramHybridListener(client)

listener.on('message', (msg) => {
  if (msg.is_outgoing) return
  console.log(`New DM in ${msg.thread_id}: ${msg.text}`)
})

listener.on('connected', ({ userId, transport }) => {
  console.log(`Listening as ${userId} via ${transport}`)
})

await listener.start()

TUI (Experimental)

A unified terminal interface for all your messaging platforms in one screen. Navigate between Slack, Discord, Teams, Webex, Telegram, WhatsApp, iMessage, LINE, Instagram, KakaoTalk, and Channel Talk — all from your terminal.

Note: The TUI is a showcase of what's possible with Agent Messenger's SDK. It demonstrates the power of having a unified adapter layer across all platforms.

agent-messenger tui

Agent Messenger TUI

Key features:

  • Multi-platform — All 11 platforms in one sidebar, auto-login on startup
  • Real-time messages — Live message streaming for supported platforms
  • Fuzzy pickers — Ctrl+K for channels, Ctrl+W for workspaces
  • Interactive auth — Authenticate platforms that aren't set up yet, right in the TUI

See the TUI docs for keybindings, architecture, and more.

Supported Platforms

FeatureSlackDiscordTeamsWebexTelegramWhatsAppLINEWeChatInstagramKakaoTalkChannel Talk (beta)
Auto credential extraction✅✅✅✅————✅✅✅
Send & list messages✅✅✅✅✅✅✅—✅✅✅
Direct messages✅✅✅✅✅✅✅✅✅✅✅
Search messages✅✅———✅——✅—✅
Message edit✅✅✅¹✅———————
Threads✅✅—————————
Channels & Users✅✅✅✅partial—✅✅——✅
Reactions✅✅✅——✅—————
Custom emoji & stickerspartial³✅—————————
File uploads✅✅✅✅—————✅—
File downloads✅——✅———————
Workspace snapshots✅✅✅✅——————✅
Multi-workspace / account✅✅✅—✅✅✅✅✅✅✅
Activity feed✅——————————
Drafts✅——————————
Saved items✅——————————
Unread messages✅✅²—————————
Sidebar sections✅——————————
Pins & bookmarks✅——————————
Scheduled messages✅——————————
Channel management✅——————————
Reminders✅——————————
User groups✅——————————
Real-time events (SDK)✅✅✅✅——✅—✅✅—
Bot support✅✅—✅✅✅—✅——✅

⚠️ Teams tokens expire in 60-90 minutes. Re-run agent-teams auth extract to refresh. See Teams Guide for details.

¹ Teams message edit applies to chats/DMs only. Channel messages are not editable through the internal API this client uses.

² Discord unread covers unread mentions in servers (agent-discord mention unread, correlating your last 7 days of mention history with per-channel read state) and unread DMs (agent-discord dm unread, comparing each DM channel's latest message against its read marker). Unread non-mention messages in server channels are not covered.

³ Slack custom emoji is read-only (agent-slack emoji list). Discord covers both custom emoji and stickers end to end — list, upload and delete. Uploading needs CREATE_GUILD_EXPRESSIONS; deleting someone else's expression needs MANAGE_GUILD_EXPRESSIONS.

💬 iMessage is supported via the local imsg tool (agent-imessage), not the table above. It runs on a Mac (Apple has no API). v1 covers send & list messages, direct & group chats, chat listing, real-time watch, and standard tapbacks. Typing, edit/unsend, group management, and targeted/custom reactions require imsg's bridge (SIP disabled) and are a later tier. See the iMessage Guide.

Platform Guides

iMessage is different

Most agent-messenger platforms run anywhere. iMessage is the exception: Apple provides no API, so agent-imessage runs on a Mac and drives Messages locally through the imsg tool. You still act as yourself with your own Apple ID and run one shell command per action, but the agent must run on the Mac (imsg is local-only — no network or server) with Full Disk Access and Automation granted. See the setup guide.

Use Cases

Gathering Context

Pull context from conversations before you start working — no tab-switching, no skimming.

"Read the #incident-api-outage thread in Slack and summarize the root cause, timeline, and action items so I can write the postmortem."

"Search our Discord #architecture channel for any previous discussion about event sourcing before I write a proposal."

"Check my unread messages across all Slack channels and tell me if anything needs my attention."

"Look through #frontend in Slack for messages about the login page redesign from the past two weeks and summarize the decisions made."

"Search Teams for any messages mentioning 'API deprecation' so I know if this was discussed before."

Communicating & Reporting

Send updates, file reports, and notify your team — all from a prompt.

"Post a deployment summary to #releases in Slack with the commit hash, changelog, and deploy status."

"Send a message to the #standup channel with what I worked on yesterday, what I'm doing today, and any blockers."

"Cross-post this announcement to #general in Slack, the announcements channel in Discord, and the General channel in Teams."

"Upload the latest test coverage report to #ci-results in Slack."

"React with ✅ to the last message in #deploy-requests to confirm I've handled it."

Automation & Pipelines

Wire messaging into your CI, scripts, or agent workflows.

"After every CI run, post the build status and test results to #builds in Slack — include the branch name and commit link."

"When a long-running migration finishes, notify me in Discord with the final row count and elapsed time."

"Every morning at 9am, snapshot my Slack workspace and post a summary of active channels to #team-pulse."

"Send an alert to #oncall in Slack whenever the error rate exceeds 1% — include the service name and a link to the dashboard."

"Read the latest message in #releases, then cross-post it to our Discord announcements channel."

...and More

These are just starting points. Your agent has full read/write access to Slack, Discord, Teams, Telegram, WhatsApp, LINE, iMessage, Instagram, KakaoTalk, and Channel Talk — anything you'd do manually in a chat app, it can handle for you. If you build something cool with Agent Messenger, let me know!

Philosophy

Why CLI, not MCP?

MCP servers expose all tools at once, bloating context and confusing agents.

MCP ApproachAgent Skills + CLI
All tools loaded at onceLoad only what you need
Bloated context windowMinimal token usage
Agent confused by optionsFocused, relevant tools
Requires a running serverOne shell command per action

With Agent Messenger, your agent loads the skill it needs, uses the CLI, and moves on. No wasted tokens. The SDK complements the CLI for when you need programmatic access—same credentials, same platform coverage, full type safety.

Why not OAuth?

OAuth requires creating an app and workspace admin approval—days of waiting just to send a message. Agent Messenger skips all of that. Your desktop apps already have valid session tokens; Agent Messenger extracts them directly so you can start messaging immediately. For platforms like Telegram, WhatsApp, and LINE, a one-time authentication flow gets you in fast.

For server-side bots and CI/CD, bot tokens are fully supported via agent-slackbot, agent-discordbot, agent-webexbot, agent-telegrambot, agent-whatsappbot, agent-wechatbot, and agent-channeltalkbot.

Inspired by agent-browser from Vercel Labs.

Contributing

bun install    # Install dependencies
bun link       # Link CLI globally for local testing
bun test       # Run tests
bun test:e2e   # Run e2e tests
bun typecheck  # Type check
bun lint       # Lint
bun lint:fix   # Lint with autofix
bun format     # Format
bun run build  # Build

Star History

Star History Chart

Thanks

License

MIT

Vendored code under src/vendor/ (linejs, linejs-types, loose-types) is MIT-licensed by Evex Developers; see the LICENSE file in each directory. Third-party projects consulted for the KakaoTalk protocol are listed in src/platforms/kakaotalk/protocol/NOTICE.md.

Details

Marketplace
agent-messenger/agent-messenger
Author
agent-messenger
Category
Productivity
Keywords
discord, messaging, guild, server, ai-agent, cli, communication
Listed since
Apr 7, 2026

More from agent-messenger/agent-messenger

All 12

Similar to agent-discord

More Email & Messaging