Skip to content

Commit

Permalink
refactor: 更新 createKeyboard 方法的返回类型以提高类型安全性
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Dec 24, 2024
1 parent 37eed30 commit acf2154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/lib/core/src/telegram/callback_query/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class AgentListCallbackQueryHandler implements CallbackQueryHandler {
return sender.editRawMessage(params);
};

private createKeyboard(names: string[]) {
private createKeyboard(names: string[]): Telegram.InlineKeyboardButton[][] {
const keyboards: Telegram.InlineKeyboardButton[][] = [];
for (let i = 0; i < names.length; i += 2) {
const row: Telegram.InlineKeyboardButton[] = [];
Expand Down Expand Up @@ -152,7 +152,7 @@ export class ModelListCallbackQueryHandler implements CallbackQueryHandler {
return sender.editRawMessage(message);
}

private async createKeyboard(models: string[], agent: string, page: number) {
private async createKeyboard(models: string[], agent: string, page: number): Promise<Telegram.InlineKeyboardButton[][]> {
const keyboard: Telegram.InlineKeyboardButton[][] = [];
const maxRow = 10;
const maxCol = Math.max(1, Math.min(5, ENV.MODEL_LIST_COLUMNS));
Expand Down

0 comments on commit acf2154

Please sign in to comment.