| import type { Bot } from "grammy"; |
| import type { HistoryEntry } from "../auto-reply/reply/history.js"; |
| import type { OpenClawConfig } from "../config/config.js"; |
| import type { |
| DmPolicy, |
| TelegramDirectConfig, |
| TelegramGroupConfig, |
| TelegramTopicConfig, |
| } from "../config/types.js"; |
| import type { StickerMetadata, TelegramContext } from "./bot/types.js"; |
|
|
| export type TelegramMediaRef = { |
| path: string; |
| contentType?: string; |
| stickerMetadata?: StickerMetadata; |
| }; |
|
|
| export type TelegramMessageContextOptions = { |
| forceWasMentioned?: boolean; |
| ingressBuffer?: "inbound-debounce" | "text-fragment"; |
| messageIdOverride?: string; |
| receivedAtMs?: number; |
| }; |
|
|
| export type TelegramLogger = { |
| info: (obj: Record<string, unknown>, msg: string) => void; |
| }; |
|
|
| export type ResolveTelegramGroupConfig = ( |
| chatId: string | number, |
| messageThreadId?: number, |
| ) => { |
| groupConfig?: TelegramGroupConfig | TelegramDirectConfig; |
| topicConfig?: TelegramTopicConfig; |
| }; |
|
|
| export type ResolveGroupActivation = (params: { |
| chatId: string | number; |
| agentId?: string; |
| messageThreadId?: number; |
| sessionKey?: string; |
| }) => boolean | undefined; |
|
|
| export type ResolveGroupRequireMention = (chatId: string | number) => boolean; |
|
|
| export type BuildTelegramMessageContextParams = { |
| primaryCtx: TelegramContext; |
| allMedia: TelegramMediaRef[]; |
| replyMedia?: TelegramMediaRef[]; |
| storeAllowFrom: string[]; |
| options?: TelegramMessageContextOptions; |
| bot: Bot; |
| cfg: OpenClawConfig; |
| account: { accountId: string }; |
| historyLimit: number; |
| groupHistories: Map<string, HistoryEntry[]>; |
| dmPolicy: DmPolicy; |
| allowFrom?: Array<string | number>; |
| groupAllowFrom?: Array<string | number>; |
| ackReactionScope: "off" | "none" | "group-mentions" | "group-all" | "direct" | "all"; |
| logger: TelegramLogger; |
| resolveGroupActivation: ResolveGroupActivation; |
| resolveGroupRequireMention: ResolveGroupRequireMention; |
| resolveTelegramGroupConfig: ResolveTelegramGroupConfig; |
| |
| sendChatActionHandler: import("./sendchataction-401-backoff.js").TelegramSendChatActionHandler; |
| }; |
|
|