Skip to content

Channels

Manage messaging channel connections for Telegram and Discord.

Overview

Channels allow agents to interact with users through messaging platforms. Moxxy supports two channels:

bash
moxxy channel <type> --agent <name>
ChannelStatusDescription
TelegramStableFull bot support with voice messages
DiscordStableBot integration with Message Content Intent

Telegram Setup

Prerequisites

  1. Create a bot via @BotFather on Telegram
  2. Save the bot token you receive

Connect Command

bash
moxxy channel telegram --agent <name>

Step-by-Step

  1. Start the setup:

    bash
    moxxy channel telegram --agent default
  2. Enter your bot token:

    ? Enter your bot token (from @BotFather): 123456789:ABCdefGHIjklMNOpqrsTUVwxyz
  3. Start your bot on Telegram:

    • Open Telegram
    • Find your bot
    • Send /start
  4. Enter the pairing code: The bot responds with a 6-digit pairing code. Enter it in the CLI:

    ? Pairing code: 123456
  5. Done. Your agent is now connected to Telegram.

Voice Messages

Voice messages sent to the bot are automatically supported. The gateway processes voice input and provides it to the agent.

Full Example

bash
$ moxxy channel telegram --agent default

  Setting up Telegram channel...

  ? Enter your bot token (from @BotFather): 123456:ABC***

  Bot configured!

  Now send /start to your bot on Telegram.
  Then enter the 6-digit pairing code you receive.

  ? Pairing code: 123456

  Telegram channel connected!

Discord Setup

Prerequisites

  1. Create a Discord application at Discord Developer Portal
  2. Create a bot user under the application
  3. Generate a bot token
  4. Enable Message Content Intent under Privileged Gateway Intents (required)
  5. Invite the bot to your server with the Bot scope and Send Messages permission

Connect Command

bash
moxxy channel discord --agent <name>

Step-by-Step

  1. Start the setup:

    bash
    moxxy channel discord --agent default
  2. Enter your bot token:

    ? Discord bot token: **********
  3. Restart the gateway to activate the bridge:

    bash
    moxxy gateway restart
  4. Send a message in any Discord channel the bot has access to.

Full Example

bash
$ moxxy channel discord --agent default

  Channel Setup: Discord

  To get a Discord bot token:
    1. Go to https://discord.com/developers/applications
    2. Create a New Application, go to Bot section
    3. Click 'Reset Token' to get a bot token
    4. Enable 'Message Content Intent' under Privileged Gateway Intents
    5. Invite the bot to your server with the Bot scope + Send Messages permission

  ? Discord bot token: **********

  Discord bot token saved for agent 'default'.

  Next steps:
    1. Make sure the bot is invited to your Discord server
    2. Restart the moxxy gateway: moxxy gateway restart
    3. Send a message in any channel the bot has access to

Channel Management via API

Channels can also be managed through the REST API:

Create a Channel

bash
curl -X POST http://127.0.0.1:3000/v1/channels \
  -H "Authorization: Bearer mox_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "telegram",
    "agent_name": "default",
    "config": {
      "bot_token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
    }
  }'

Pair a Channel

bash
curl -X POST http://127.0.0.1:3000/v1/channels/pair \
  -H "Authorization: Bearer mox_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "channel_id": "chan_abc123",
    "pair_code": "123456"
  }'

Delete a Channel

bash
curl -X DELETE http://127.0.0.1:3000/v1/channels/chan_abc123 \
  -H "Authorization: Bearer mox_your_token"

Multiple Agents, Multiple Channels

Each agent can have its own channel connections:

bash
# Agent 1 on Telegram
moxxy channel telegram --agent assistant

# Agent 2 on Discord
moxxy channel discord --agent researcher

Troubleshooting

Bot Not Responding

  1. Check gateway status:

    bash
    moxxy gateway status
  2. Verify the gateway is running and the channel bridge loaded at startup (check logs).

  3. Restart the gateway to reload channel bridges:

    bash
    moxxy gateway restart

Telegram Pairing Failed

  • Ensure you sent /start to the bot before entering the pairing code
  • Pairing codes expire after a short window; try again if it timed out
  • Verify the bot token is correct

Discord Bot Not Responding

  • Ensure Message Content Intent is enabled in the Discord Developer Portal
  • Verify the bot has been invited to the server with appropriate permissions
  • Check that the bot token is valid and has not been regenerated since setup

Open source · Self-hosted · Data sovereign