refactor(telegram): update logger type to use tslog for improved type safety

This commit is contained in:
Yash 2026-01-28 07:30:40 +01:00
parent ab52104f4c
commit 03842071e3
No known key found for this signature in database
GPG Key ID: B645569271768423

View File

@ -31,6 +31,7 @@ import type {
} from "../config/types.telegram.js"; } from "../config/types.telegram.js";
import type { RuntimeEnv } from "../runtime.js"; import type { RuntimeEnv } from "../runtime.js";
import type { ChannelGroupPolicy } from "../config/group-policy.js"; import type { ChannelGroupPolicy } from "../config/group-policy.js";
import { Logger } from "tslog";
type TelegramHandlersParams = { type TelegramHandlersParams = {
cfg: MoltbotConfig; cfg: MoltbotConfig;
@ -57,7 +58,7 @@ type TelegramHandlersParams = {
storeAllowFrom: string[], storeAllowFrom: string[],
options?: { forceWasMentioned?: boolean; messageIdOverride?: string }, options?: { forceWasMentioned?: boolean; messageIdOverride?: string },
) => Promise<void>; ) => Promise<void>;
logger: { info: (obj: Record<string, unknown>, msg: string) => void }; logger: Logger<Record<string, unknown>>;
}; };
export const registerTelegramHandlers = ({ export const registerTelegramHandlers = ({