Skip to main content

Multi-Platform Channels Overview

The Channel system turns Elftia into a cross-platform AI bot. You can connect an Agent to Discord, Telegram, Slack, and other platforms simultaneously — receiving messages, calling tools, and generating replies from anywhere.

When to Use

  • You want to deploy an AI assistant bot in a Discord server
  • You need to have private conversations with an Agent via Telegram
  • You want to integrate an AI collaborator into a Slack workspace
  • You want the same Agent to serve users across multiple platforms at once

Supported Platforms

PlatformType IDConnection MethodMax Message LengthCategory
DiscorddiscordBot Token2,000 charactersCore
TelegramtelegramBot Token4,096 charactersCore
SlackslackBot Token + App Token4,000 charactersCore
QQ BotqqbotBot Token1,500 charactersChina
LINElineChannel Access Token + Secret5,000 charactersCore
EmailemailSMTP + IMAP credentials100,000 charactersCore
WhatsAppwhatsappPhone number65,000 charactersCore
WeChatwechatWechaty Token2,000 charactersChina
MatrixmatrixAccess Token65,536 charactersExtended
Microsoft TeamsmsteamsApp ID + Password28,000 charactersExtended
MattermostmattermostBot Token16,383 charactersExtended
WeCom (Enterprise WeChat)wecomWebhook Key4,000 charactersChina
WeCom (App)wecom-appCorp ID + Secret4,000 charactersChina

:::tip Platforms Are Plugins All platforms are implemented via Channel plugins. Built-in plugins ship with the app; additional plugins can be downloaded and installed via the Marketplace. :::

Core Concepts

Channel Instance

Each Channel instance represents a connection to an external platform. You can create multiple instances for the same platform (e.g., connecting two different Discord bots). Each instance independently manages its own:

  • Credentials: the token/key required to connect
  • Trigger rules: determine when the Agent should reply (see Trigger Rules & Security)
  • Connection state: disconnected / connecting / connected / error

Trigger Rules

Trigger rules determine which messages the Agent responds to:

ModeDescriptionBest For
allReply to all messagesPersonal bots, test environments
mentionReply only when @mentionedMulti-user groups, shared servers
keywordReply when a specified keyword is matchedTopic-specific triggers
dm_onlyReply to direct messages onlyPublic groups where only private chat is accepted

Security Pipeline

Every message passes through multiple security checks before reaching the Agent:

  1. InputSanitizer — strips invisible control characters
  2. RateLimiter — rate limiting (prevents spam flooding)
  3. PromptGuardian — AI-driven prompt injection detection
  4. UserPermissionService — role-based access control
  5. ChannelPermissionGate — sensitive operation confirmation mechanism

Workflow

External platform message (Discord/Telegram/...)


Channel Plugin ─── receive and parse message


ChannelPluginRegistry ─── convert to unified ChannelMessage format


ChannelMessageRouter ─── security pipeline checks + trigger rule matching


ChannelMagiBridge ─── convert to MagiIncomingMessage


MagiService (Agent) ─── process and generate reply


ChannelMessageRouter ─── format + message splitting


Channel Plugin ─── send reply back to the original platform

Plugin Architecture

The Channel system uses a plugin-based architecture supporting two plugin sources:

SourceDirectoryDescriptionPriority
Built-in (Bundled)resources/bundled-channel-plugins/Distributed with the app installer; read-onlyLower
User (Marketplace){userData}/channel-plugins/Downloaded from Marketplace or manually installed; read/writeHigher

When the same plugin type exists in both directories, the user directory version takes precedence (potentially a newer Marketplace version).

Each plugin must include an elftia-channel.json manifest file declaring the plugin type, entry file, required credentials, and other information.

Quick Start

  1. Open Settings → Channel
  2. Click Add Channel and select a platform (e.g., Discord)
  3. If the plugin is not installed, the system will automatically download it from the Marketplace
  4. Enter the platform credentials (e.g., Discord Bot Token)
  5. Configure the trigger rules (recommended: start with mention mode for testing)
  6. Click Connect to start the instance
  7. Send a message to the bot on the corresponding platform to verify the connection

Next Steps