mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-07 07:11:06 +00:00
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
|
import { resolveTelegramAccount } from "./accounts.js";
|
|
import { resolveTelegramAutoThreadId } from "./action-threading.js";
|
|
import { buildTelegramThreadingToolContext } from "./threading-tool-context.js";
|
|
|
|
export function resolveTelegramReplyToMode(params: { cfg: OpenClawConfig; accountId: string }) {
|
|
return resolveTelegramAccount({ cfg: params.cfg, accountId: params.accountId }).config
|
|
.replyToMode;
|
|
}
|
|
|
|
export const telegramThreading = {
|
|
scopedAccountReplyToMode: {
|
|
resolveAccount: (cfg: OpenClawConfig, accountId: string) =>
|
|
resolveTelegramAccount({ cfg, accountId }),
|
|
resolveReplyToMode: (account: ReturnType<typeof resolveTelegramAccount>) =>
|
|
account.config.replyToMode,
|
|
fallback: "off" as const,
|
|
},
|
|
buildToolContext: (params: Parameters<typeof buildTelegramThreadingToolContext>[0]) =>
|
|
buildTelegramThreadingToolContext(params),
|
|
resolveAutoThreadId: ({
|
|
to,
|
|
toolContext,
|
|
}: {
|
|
to: string;
|
|
toolContext?: { currentThreadTs?: string; currentChannelId?: string };
|
|
}) => resolveTelegramAutoThreadId({ to, toolContext }),
|
|
};
|