fix(telegram): exclude plugin commands from setMyCommands when native=false (openclaw#15164) thanks @Glucksberg

Verified:
- pnpm install --frozen-lockfile
- pnpm build
- pnpm check
- pnpm test

Co-authored-by: Glucksberg <80581902+Glucksberg@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Glucksberg
2026-02-14 15:22:58 -04:00
committed by GitHub
parent 65eefd65e1
commit f537bd1796
5 changed files with 15 additions and 45 deletions

View File

@@ -339,7 +339,7 @@ export const registerTelegramNativeCommands = ({
command: command.name,
description: command.description,
})),
...pluginCatalog.commands,
...(nativeEnabled ? pluginCatalog.commands : []),
...customCommands,
];
const { commandsToRegister, totalCommands, maxCommands, overflowCount } =
@@ -357,7 +357,7 @@ export const registerTelegramNativeCommands = ({
// Keep hidden commands callable by registering handlers for the full catalog.
syncTelegramMenuCommands({ bot, runtime, commandsToRegister });
if (commandsToRegister.length > 0) {
if (commandsToRegister.length > 0 || pluginCatalog.commands.length > 0) {
if (typeof (bot as unknown as { command?: unknown }).command !== "function") {
logVerbose("telegram: bot.command unavailable; skipping native handlers");
} else {