Skip to content

Anvia Channels ​

Anvia Channels is a set of platform adapters that connect Discord, Slack, and Telegram to the Anvia runtime in strict TypeScript. Adapters normalize incoming platform payloads into ChannelEvent values and deliver outbound messages through each platform's native API.

Channels are a separate workspace from the Anvia SDK. The SDK owns the model and agent runtime; Channels own platform input and delivery. Your application keeps owning credentials, persistence, and deployment.

The five libraries are currently private workspace packages while live-platform verification completes. They are not published to npm yet; the package names below are the intended installation names.

Packages ​

PackageUse it forStart with
@anvia/channelPlatform-neutral addresses, events, messages, validation, and delivery helperssendChannelMessage()
@anvia/channel-agentRunning an Anvia agent behind any channel adaptercreateChannelAgent()
@anvia/discordDiscord Gateway input and REST deliverydiscord()
@anvia/slackSlack Socket Mode input and Web API deliveryslack()
@anvia/telegramTelegram polling, webhook input, and Bot API deliverytelegram()

Platform capabilities ​

PlatformReceive transportFilesNative actionsReplies and threadsTyping
DiscordGatewayYesButtonsYesYes
SlackSocket ModeYesBlock Kit buttonsYesNo
TelegramLong polling or webhookYesInline keyboardYesYes

All three adapters expose message edits, deletion, and reactions. Optional operations are advertised through channel.capabilities.

Run an agent on a channel ​

Create a platform adapter, pass it and an existing Anvia agent to createChannelAgent(), and start the returned service:

ts
import { createChannelAgent } from '@anvia/channel-agent'
import { telegram } from '@anvia/telegram'

const channel = telegram({ token: process.env.TELEGRAM_BOT_TOKEN! })
const service = createChannelAgent({
  channel,
  agent,
  streaming: { placeholder: 'Thinking…' },
})

await service.start()

process.once('SIGTERM', () => {
  void service.stop()
})

The bridge handles default message filtering, stable conversation sessions, multimodal prompts, streaming edits, long-message splitting, native actions, and paused approval or question flows. It also handles platform slash commands (opt-in per command), acknowledgement reactions while the agent works, and reaction cleanup on completion. See Channel-agent bridge.

Send proactively ​

An alerting or worker process only needs a platform adapter and sendChannelMessage(). Receiving does not need to be started:

ts
import { sendChannelMessage } from '@anvia/channel'
import { discord } from '@anvia/discord'

const channel = discord({ token: process.env.DISCORD_BOT_TOKEN! })

await sendChannelMessage({
  channel,
  address: { platform: 'discord', conversationId: process.env.DISCORD_CHANNEL_ID! },
  message: {
    text: monitoringReport,
    actions: [{ id: 'incident:ack', label: 'Acknowledge', style: 'primary' }],
  },
})

sendChannelMessage() splits long text according to the selected platform. Use channel.send() only for one already-bounded logical message. See Channel core.

Choose a utility ​

You need to…UsePackage
Represent a platform-independent address or messageChannelAddress, ChannelMessage@anvia/channel
Send output that may exceed a platform text limitsendChannelMessage()@anvia/channel
Split text in a custom adaptersplitChannelMessage() or splitChannelText()@anvia/channel
Validate portable buttons or files at runtimevalidateChannelActions(), validateChannelAttachments()@anvia/channel
Create a Discord adapterdiscord()@anvia/discord
Create a Slack adapterslack()@anvia/slack
Create a Telegram adaptertelegram()@anvia/telegram
Connect an adapter to an existing Anvia agentcreateChannelAgent()@anvia/channel-agent
Preserve incoming attachments in a custom promptchannelMessagePrompt()@anvia/channel-agent
Keep approvals/questions across restartsSqliteChannelAgentInteractionStore@anvia/channel-agent

Continue with ​

Built for Anvia.