mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 07:51:26 +00:00
chore: Enable typescript/no-explicit-any rule.
This commit is contained in:
@@ -49,6 +49,7 @@ export const dispatchTelegramMessage = async ({
|
||||
telegramCfg,
|
||||
opts,
|
||||
resolveBotTopicsEnabled,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
}: any) => {
|
||||
const {
|
||||
ctxPayload,
|
||||
|
||||
@@ -446,7 +446,9 @@ export function createTelegramBot(opts: TelegramBotOptions) {
|
||||
senderLabel = senderLabel || "unknown";
|
||||
|
||||
// Extract forum thread info (similar to message processing)
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const messageThreadId = (reaction as any).message_thread_id;
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
const isForum = (reaction.chat as any).is_forum === true;
|
||||
const resolvedThreadId = resolveTelegramForumThreadId({
|
||||
isForum,
|
||||
|
||||
@@ -78,6 +78,7 @@ describe("normalizeForwardedContext", () => {
|
||||
sender_user: { first_name: "Ada", last_name: "Lovelace", username: "ada", id: 42 },
|
||||
date: 123,
|
||||
},
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any);
|
||||
expect(ctx).not.toBeNull();
|
||||
expect(ctx?.from).toBe("Ada Lovelace (@ada)");
|
||||
@@ -91,6 +92,7 @@ describe("normalizeForwardedContext", () => {
|
||||
it("handles hidden forward_origin names", () => {
|
||||
const ctx = normalizeForwardedContext({
|
||||
forward_origin: { type: "hidden_user", sender_user_name: "Hidden Name", date: 456 },
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any);
|
||||
expect(ctx).not.toBeNull();
|
||||
expect(ctx?.from).toBe("Hidden Name");
|
||||
@@ -109,6 +111,7 @@ describe("normalizeForwardedContext", () => {
|
||||
},
|
||||
forward_signature: "Stan",
|
||||
forward_date: 789,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any);
|
||||
expect(ctx).not.toBeNull();
|
||||
expect(ctx?.from).toBe("OpenClaw Updates (Stan)");
|
||||
@@ -124,6 +127,7 @@ describe("normalizeForwardedContext", () => {
|
||||
const ctx = normalizeForwardedContext({
|
||||
forward_sender_name: "Legacy Hidden",
|
||||
forward_date: 111,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any);
|
||||
expect(ctx).not.toBeNull();
|
||||
expect(ctx?.from).toBe("Legacy Hidden");
|
||||
|
||||
@@ -5,6 +5,7 @@ describe("createTelegramDraftStream", () => {
|
||||
it("passes message_thread_id when provided", () => {
|
||||
const api = { sendMessageDraft: vi.fn().mockResolvedValue(true) };
|
||||
const stream = createTelegramDraftStream({
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
api: api as any,
|
||||
chatId: 123,
|
||||
draftId: 42,
|
||||
@@ -21,6 +22,7 @@ describe("createTelegramDraftStream", () => {
|
||||
it("omits message_thread_id for general topic id", () => {
|
||||
const api = { sendMessageDraft: vi.fn().mockResolvedValue(true) };
|
||||
const stream = createTelegramDraftStream({
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
api: api as any,
|
||||
chatId: 123,
|
||||
draftId: 42,
|
||||
@@ -35,6 +37,7 @@ describe("createTelegramDraftStream", () => {
|
||||
it("keeps message_thread_id for dm threads", () => {
|
||||
const api = { sendMessageDraft: vi.fn().mockResolvedValue(true) };
|
||||
const stream = createTelegramDraftStream({
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
api: api as any,
|
||||
chatId: 123,
|
||||
draftId: 42,
|
||||
|
||||
Reference in New Issue
Block a user