Skip to content

Commit 5b468b7

Browse files
committed
feat: 优化管理端回调按钮生成逻辑,改进验证码类型选择界面
1 parent f1ceb09 commit 5b468b7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎functions/_shared/bot.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,10 +1808,11 @@ async function handleAdmCb(q, action, { tg, db, kv, settings, chatId, msgId, adm
18081808
hcaptcha: t('panel.cap.hcaptcha'),
18091809
};
18101810
const cur = settings.CAPTCHA_TYPE || 'math';
1811-
const kb = all.map(type => [{
1811+
const btns = all.map(type => ({
18121812
text: (type === cur ? '✅ ' : '') + (labelMap[type] || type),
18131813
callback_data: `adm:ct:set:${type}`,
1814-
}]);
1814+
}));
1815+
const kb = rowsN(btns, 2, b => b);
18151816
kb.push([{ text: t('cb.back'), callback_data: 'adm:cfg' }]);
18161817
await editUserText({ tg, settings, waitUntil, chatId, msgId, text: t('panel.captchaType') + ':', kb });
18171818
await tg.answerCb({ id: q.id }).catch(() => {});

0 commit comments

Comments
 (0)