mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-28 19:03:38 +00:00
19 lines
659 B
TypeScript
19 lines
659 B
TypeScript
// Telegram plugin module implements allowed updates behavior.
|
|
import { API_CONSTANTS } from "grammy";
|
|
|
|
export type TelegramUpdateType = (typeof API_CONSTANTS.ALL_UPDATE_TYPES)[number];
|
|
|
|
export const DEFAULT_TELEGRAM_UPDATE_TYPES: ReadonlyArray<TelegramUpdateType> =
|
|
API_CONSTANTS.DEFAULT_UPDATE_TYPES;
|
|
|
|
export function resolveTelegramAllowedUpdates(): ReadonlyArray<TelegramUpdateType> {
|
|
const updates = [...DEFAULT_TELEGRAM_UPDATE_TYPES] as TelegramUpdateType[];
|
|
if (!updates.includes("message_reaction")) {
|
|
updates.push("message_reaction");
|
|
}
|
|
if (!updates.includes("channel_post")) {
|
|
updates.push("channel_post");
|
|
}
|
|
return updates;
|
|
}
|