Files
openclaw/src/telegram/allowed-updates.ts
Sam Padilla e4816aae80 feat(telegram): add channel_post support for bot-to-bot communication
Telegram bots cannot see messages from other bots in groups — this is a
hard platform limitation. However, bots CAN see other bot messages in
Telegram channels (broadcast channels).

This patch:
- Adds 'channel_post' to the allowed Telegram update types
- Registers a channel_post handler that normalizes channel posts into
  the existing message pipeline via synthetic message/context objects
- Enables bot-to-bot wake signals via private Telegram channels

Use case: external services (APIs, CRMs) can send wake/trigger signals
to an OpenClaw bot through a dedicated Telegram channel using a second
bot, without exposing the gateway.
2026-02-17 14:16:29 +05:30

15 lines
475 B
TypeScript

import { API_CONSTANTS } from "grammy";
type TelegramUpdateType = (typeof API_CONSTANTS.ALL_UPDATE_TYPES)[number];
export function resolveTelegramAllowedUpdates(): ReadonlyArray<TelegramUpdateType> {
const updates = [...API_CONSTANTS.DEFAULT_UPDATE_TYPES] as TelegramUpdateType[];
if (!updates.includes("message_reaction")) {
updates.push("message_reaction");
}
if (!updates.includes("channel_post")) {
updates.push("channel_post");
}
return updates;
}