feat: add agent preset chat commands

This commit is contained in:
xmanrui 2026-08-22 04:04:44 +08:00
parent 2ad6f1a44e
commit eea29fe296
33 changed files with 1519 additions and 234 deletions

View file

@ -168,6 +168,13 @@ test('Telegram API registers the command menu and commands-type menu button', as
await api.setMyCommands({ commands: TELEGRAM_COMMAND_MENU });
await api.setChatMenuButton();
assert.equal(calls.length, 2);
assert.deepEqual(
TELEGRAM_COMMAND_MENU.filter(({ command }) => command === 'presetlist' || command === 'preset'),
[
{ command: 'presetlist', description: '列出可用 Agent Preset' },
{ command: 'preset', description: '查看或设置新会话 Agent Preset' },
],
);
assert.match(calls[0].url.pathname, /setMyCommands$/);
assert.deepEqual(calls[0].body, { commands: TELEGRAM_COMMAND_MENU });
assert.match(calls[1].url.pathname, /setChatMenuButton$/);