mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-14 09:40:43 +00:00
18 lines
596 B
TypeScript
18 lines
596 B
TypeScript
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;
|
|
}
|