mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-24 07:14:27 +00:00
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.
15 lines
475 B
TypeScript
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;
|
|
}
|