mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:51:24 +00:00
Telegram: remove @ts-nocheck from bot.ts, fix duplicate error handler, harden sticker caching (#9077)
* Telegram: remove @ts-nocheck from bot.ts and bot-message-dispatch.ts - bot/types.ts: TelegramContext.me uses UserFromGetMe (Grammy) instead of manual inline type - bot.ts: remove 6 unsafe casts (as any, as unknown, as object), use Grammy types directly - bot.ts: remove dead message_thread_id access on reactions (not in Telegram Bot API) - bot.ts: remove resolveThreadSessionKeys import (no longer needed for reactions) - bot-message-dispatch.ts: replace ': any' with DispatchTelegramMessageParams type - bot-message-dispatch.ts: add sticker.fileId guard before cache access - bot.test.ts: update reaction tests, remove dead DM thread-reaction test * Telegram: remove duplicate bot.catch handler (only the last one runs in Grammy) * Telegram: remove @ts-nocheck from bot.ts, fix duplicate error handler, harden sticker caching (#9077)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { Message } from "@grammyjs/types";
|
||||
import type { Message, UserFromGetMe } from "@grammyjs/types";
|
||||
|
||||
/** App-specific stream mode for Telegram draft streaming. */
|
||||
export type TelegramStreamMode = "off" | "partial" | "block";
|
||||
@@ -10,7 +10,7 @@ export type TelegramStreamMode = "off" | "partial" | "block";
|
||||
*/
|
||||
export type TelegramContext = {
|
||||
message: Message;
|
||||
me?: { id?: number; username?: string };
|
||||
me?: UserFromGetMe;
|
||||
getFile: () => Promise<{ file_path?: string }>;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user