mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 01:21:36 +00:00
* refactor: move Telegram channel implementation to extensions/telegram/src/ Move all Telegram channel code (123 files + 10 bot/ files + 8 channel plugin files) from src/telegram/ and src/channels/plugins/*/telegram.ts to extensions/telegram/src/. Leave thin re-export shims at original locations so cross-cutting src/ imports continue to resolve. - Fix all relative import paths in moved files (../X/ -> ../../../src/X/) - Fix vi.mock paths in 60 test files - Fix inline typeof import() expressions - Update tsconfig.plugin-sdk.dts.json rootDir to "." for cross-directory DTS - Update write-plugin-sdk-entry-dts.ts for new rootDir structure - Move channel plugin files with correct path remapping * fix: support keyed telegram send deps * fix: sync telegram extension copies with latest main * fix: correct import paths and remove misplaced files in telegram extension * fix: sync outbound-adapter with main (add sendTelegramPayloadMessages) and fix delivery.test import path
29 lines
841 B
TypeScript
29 lines
841 B
TypeScript
import type { OpenClawConfig } from "../../../src/config/config.js";
|
|
import {
|
|
resolveReactionLevel,
|
|
type ReactionLevel,
|
|
type ResolvedReactionLevel as BaseResolvedReactionLevel,
|
|
} from "../../../src/utils/reaction-level.js";
|
|
import { resolveTelegramAccount } from "./accounts.js";
|
|
|
|
export type TelegramReactionLevel = ReactionLevel;
|
|
export type ResolvedReactionLevel = BaseResolvedReactionLevel;
|
|
|
|
/**
|
|
* Resolve the effective reaction level and its implications.
|
|
*/
|
|
export function resolveTelegramReactionLevel(params: {
|
|
cfg: OpenClawConfig;
|
|
accountId?: string;
|
|
}): ResolvedReactionLevel {
|
|
const account = resolveTelegramAccount({
|
|
cfg: params.cfg,
|
|
accountId: params.accountId,
|
|
});
|
|
return resolveReactionLevel({
|
|
value: account.config.reactionLevel,
|
|
defaultLevel: "minimal",
|
|
invalidFallback: "ack",
|
|
});
|
|
}
|