Skip to content

Commit

Permalink
refactor: 更新回调查询处理程序的静态方法名称以提高可读性
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Dec 24, 2024
1 parent 0249f60 commit c70286c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/lib/core/src/config/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BUILD_TIMESTAMP = 1735026022;
export const BUILD_VERSION = '284e897';
export const BUILD_TIMESTAMP = 1735026382;
export const BUILD_VERSION = '0249f60';
12 changes: 6 additions & 6 deletions packages/lib/core/src/telegram/callback_query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { MessageSender } from '../sender';
import { AgentListCallbackQueryHandler, ModelChangeCallbackQueryHandler, ModelListCallbackQueryHandler } from './system';

const QUERY_HANDLERS = [
AgentListCallbackQueryHandler.NewChatAgentListCallbackQueryHandler(),
AgentListCallbackQueryHandler.NewImageAgentListCallbackQueryHandler(),
ModelListCallbackQueryHandler.NewChatModelListCallbackQueryHandler(),
ModelListCallbackQueryHandler.NewImageModelListCallbackQueryHandler(),
ModelChangeCallbackQueryHandler.NewChatModelChangeCallbackQueryHandler(),
ModelChangeCallbackQueryHandler.NewImageModelChangeCallbackQueryHandler(),
AgentListCallbackQueryHandler.Chat(),
AgentListCallbackQueryHandler.Image(),
ModelListCallbackQueryHandler.Chat(),
ModelListCallbackQueryHandler.Image(),
ModelChangeCallbackQueryHandler.Chat(),
ModelChangeCallbackQueryHandler.Image(),
];

export async function handleCallbackQuery(callbackQuery: Telegram.CallbackQuery, context: WorkerContext): Promise<Response | null> {
Expand Down
12 changes: 6 additions & 6 deletions packages/lib/core/src/telegram/callback_query/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export class AgentListCallbackQueryHandler implements CallbackQueryHandler {
this.changeAgentPrefix = changeAgentPrefix;
}

static NewChatAgentListCallbackQueryHandler(): AgentListCallbackQueryHandler {
static Chat(): AgentListCallbackQueryHandler {
return new AgentListCallbackQueryHandler('al:', 'ca:', () => {
return CHAT_AGENTS.filter(agent => agent.enable(ENV.USER_CONFIG)).map(agent => agent.name);
});
}

static NewImageAgentListCallbackQueryHandler(): AgentListCallbackQueryHandler {
static Image(): AgentListCallbackQueryHandler {
return new AgentListCallbackQueryHandler('ial:', 'ica:', () => {
return IMAGE_AGENTS.filter(agent => agent.enable(ENV.USER_CONFIG)).map(agent => agent.name);
});
Expand Down Expand Up @@ -100,11 +100,11 @@ export class ModelListCallbackQueryHandler implements CallbackQueryHandler {
this.changeAgentType = changeAgentType;
}

static NewChatModelListCallbackQueryHandler(): ModelListCallbackQueryHandler {
static Chat(): ModelListCallbackQueryHandler {
return new ModelListCallbackQueryHandler('ca:', 'al:', 'cm:', loadChatLLM, changeChatAgentType);
}

static NewImageModelListCallbackQueryHandler(): ModelListCallbackQueryHandler {
static Image(): ModelListCallbackQueryHandler {
return new ModelListCallbackQueryHandler('ica:', 'ial:', 'icm:', loadImageGen, changeImageAgentType);
}

Expand Down Expand Up @@ -192,11 +192,11 @@ export class ModelChangeCallbackQueryHandler implements CallbackQueryHandler {
this.changeAgentType = changeAgentType;
}

static NewChatModelChangeCallbackQueryHandler(): ModelChangeCallbackQueryHandler {
static Chat(): ModelChangeCallbackQueryHandler {
return new ModelChangeCallbackQueryHandler('cm:', loadChatLLM, changeChatAgentType);
}

static NewImageModelChangeCallbackQueryHandler(): ModelChangeCallbackQueryHandler {
static Image(): ModelChangeCallbackQueryHandler {
return new ModelChangeCallbackQueryHandler('icm:', loadChatLLM, changeImageAgentType);
}

Expand Down

0 comments on commit c70286c

Please sign in to comment.