fix: Remove unused variables and imports to pass lint

- Prefix unused variable _isExecEvent in heartbeat-runner.ts
- Remove unused TelegramGramJSAccountConfig import from config.ts
- Remove unused SessionOptions import from client.ts
- Prefix unused proxy parameter as _proxy in client.ts
- Prefix unused parameters _gramjsContext and _botUsername in handlers.ts
- Remove unused OpenClawConfig import from types.ts
- Remove unused AuthState import from auth.test.ts

Fixes lint CI failure on PR #4465
This commit is contained in:
spiceoogway 2026-01-30 03:22:43 -05:00
parent 56bf6f5e49
commit 5305e54adf
6 changed files with 7 additions and 17 deletions

View File

@ -506,7 +506,7 @@ export async function runHeartbeatOnce(opts: {
// Check if this is an exec event with pending exec completion system events. // Check if this is an exec event with pending exec completion system events.
// If so, use a specialized prompt that instructs the model to relay the result // If so, use a specialized prompt that instructs the model to relay the result
// instead of the standard heartbeat prompt with "reply HEARTBEAT_OK". // instead of the standard heartbeat prompt with "reply HEARTBEAT_OK".
const isExecEvent = opts.reason === "exec-event"; const _isExecEvent = opts.reason === "exec-event";
const pendingEvents = peekSystemEvents(sessionKey); const pendingEvents = peekSystemEvents(sessionKey);
const hasExecCompletion = pendingEvents.some((evt) => evt.includes("Exec finished")); const hasExecCompletion = pendingEvents.some((evt) => evt.includes("Exec finished"));
// Check for generic (non-exec) system events that may require action (e.g., from cron jobs). // Check for generic (non-exec) system events that may require action (e.g., from cron jobs).

View File

@ -4,7 +4,6 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { AuthFlow, verifySession } from "./auth.js"; import { AuthFlow, verifySession } from "./auth.js";
import type { AuthState } from "./types.js";
// Mock readline to avoid stdin/stdout in tests // Mock readline to avoid stdin/stdout in tests
const mockPrompt = vi.fn(); const mockPrompt = vi.fn();

View File

@ -13,12 +13,7 @@ import { StringSession } from "telegram/sessions";
import { NewMessage, type NewMessageEvent } from "telegram/events"; import { NewMessage, type NewMessageEvent } from "telegram/events";
import type { Api } from "telegram"; import type { Api } from "telegram";
import { createSubsystemLogger } from "../logging/subsystem.js"; import { createSubsystemLogger } from "../logging/subsystem.js";
import type { import type { ConnectionState, GramJSMessageContext, SendMessageParams } from "./types.js";
ConnectionState,
GramJSMessageContext,
SendMessageParams,
SessionOptions,
} from "./types.js";
const log = createSubsystemLogger("telegram-gramjs:client"); const log = createSubsystemLogger("telegram-gramjs:client");
@ -45,7 +40,7 @@ export class GramJSClient {
apiId, apiId,
apiHash, apiHash,
sessionString = "", sessionString = "",
proxy, proxy: _proxy,
connectionRetries = 5, connectionRetries = 5,
timeout = 30, timeout = 30,
} = options; } = options;

View File

@ -8,10 +8,7 @@
*/ */
import type { OpenClawConfig } from "../config/config.js"; import type { OpenClawConfig } from "../config/config.js";
import type { import type { TelegramGramJSConfig } from "../config/types.telegram-gramjs.js";
TelegramGramJSAccountConfig,
TelegramGramJSConfig,
} from "../config/types.telegram-gramjs.js";
import type { ChannelConfigAdapter } from "../channels/plugins/types.adapters.js"; import type { ChannelConfigAdapter } from "../channels/plugins/types.adapters.js";
import type { ResolvedGramJSAccount } from "./types.js"; import type { ResolvedGramJSAccount } from "./types.js";
import { createSubsystemLogger } from "../logging/subsystem.js"; import { createSubsystemLogger } from "../logging/subsystem.js";

View File

@ -12,7 +12,7 @@ const log = createSubsystemLogger("telegram-gramjs:handlers");
* Convert GramJS message context to openclaw MsgContext. * Convert GramJS message context to openclaw MsgContext.
*/ */
export async function convertToMsgContext( export async function convertToMsgContext(
gramjsContext: GramJSMessageContext, _gramjsContext: GramJSMessageContext,
account: ResolvedGramJSAccount, account: ResolvedGramJSAccount,
accountId: string, accountId: string,
): Promise<MsgContext | null> { ): Promise<MsgContext | null> {
@ -169,8 +169,8 @@ export function buildSessionKey(gramjsContext: GramJSMessageContext, accountId:
* - Checking message.entities for mentions * - Checking message.entities for mentions
*/ */
export function wasMessageMentioned( export function wasMessageMentioned(
gramjsContext: GramJSMessageContext, _gramjsContext: GramJSMessageContext,
botUsername?: string, _botUsername?: string,
): boolean { ): boolean {
// TODO: Implement mention detection // TODO: Implement mention detection
// For now, return false (rely on requireMention config) // For now, return false (rely on requireMention config)

View File

@ -3,7 +3,6 @@
*/ */
import type { TelegramGramJSAccountConfig } from "../config/types.telegram-gramjs.js"; import type { TelegramGramJSAccountConfig } from "../config/types.telegram-gramjs.js";
import type { OpenClawConfig } from "../config/config.js";
/** /**
* Resolved account configuration with all necessary fields populated. * Resolved account configuration with all necessary fields populated.