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:
parent
56bf6f5e49
commit
5305e54adf
@ -506,7 +506,7 @@ export async function runHeartbeatOnce(opts: {
|
||||
// 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
|
||||
// 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 hasExecCompletion = pendingEvents.some((evt) => evt.includes("Exec finished"));
|
||||
// Check for generic (non-exec) system events that may require action (e.g., from cron jobs).
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { AuthFlow, verifySession } from "./auth.js";
|
||||
import type { AuthState } from "./types.js";
|
||||
|
||||
// Mock readline to avoid stdin/stdout in tests
|
||||
const mockPrompt = vi.fn();
|
||||
|
||||
@ -13,12 +13,7 @@ import { StringSession } from "telegram/sessions";
|
||||
import { NewMessage, type NewMessageEvent } from "telegram/events";
|
||||
import type { Api } from "telegram";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
import type {
|
||||
ConnectionState,
|
||||
GramJSMessageContext,
|
||||
SendMessageParams,
|
||||
SessionOptions,
|
||||
} from "./types.js";
|
||||
import type { ConnectionState, GramJSMessageContext, SendMessageParams } from "./types.js";
|
||||
|
||||
const log = createSubsystemLogger("telegram-gramjs:client");
|
||||
|
||||
@ -45,7 +40,7 @@ export class GramJSClient {
|
||||
apiId,
|
||||
apiHash,
|
||||
sessionString = "",
|
||||
proxy,
|
||||
proxy: _proxy,
|
||||
connectionRetries = 5,
|
||||
timeout = 30,
|
||||
} = options;
|
||||
|
||||
@ -8,10 +8,7 @@
|
||||
*/
|
||||
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type {
|
||||
TelegramGramJSAccountConfig,
|
||||
TelegramGramJSConfig,
|
||||
} from "../config/types.telegram-gramjs.js";
|
||||
import type { TelegramGramJSConfig } from "../config/types.telegram-gramjs.js";
|
||||
import type { ChannelConfigAdapter } from "../channels/plugins/types.adapters.js";
|
||||
import type { ResolvedGramJSAccount } from "./types.js";
|
||||
import { createSubsystemLogger } from "../logging/subsystem.js";
|
||||
|
||||
@ -12,7 +12,7 @@ const log = createSubsystemLogger("telegram-gramjs:handlers");
|
||||
* Convert GramJS message context to openclaw MsgContext.
|
||||
*/
|
||||
export async function convertToMsgContext(
|
||||
gramjsContext: GramJSMessageContext,
|
||||
_gramjsContext: GramJSMessageContext,
|
||||
account: ResolvedGramJSAccount,
|
||||
accountId: string,
|
||||
): Promise<MsgContext | null> {
|
||||
@ -169,8 +169,8 @@ export function buildSessionKey(gramjsContext: GramJSMessageContext, accountId:
|
||||
* - Checking message.entities for mentions
|
||||
*/
|
||||
export function wasMessageMentioned(
|
||||
gramjsContext: GramJSMessageContext,
|
||||
botUsername?: string,
|
||||
_gramjsContext: GramJSMessageContext,
|
||||
_botUsername?: string,
|
||||
): boolean {
|
||||
// TODO: Implement mention detection
|
||||
// For now, return false (rely on requireMention config)
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
import type { TelegramGramJSAccountConfig } from "../config/types.telegram-gramjs.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
/**
|
||||
* Resolved account configuration with all necessary fields populated.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user