Summary
When a plugin registers a command via api.registerCommand() and returns inline keyboard buttons (via channelData.telegram.buttons), clicking those buttons works correctly in group forum topics but does nothing in DMs — the handler is never invoked and no log output appears.
The command itself works fine in DMs when typed manually (e.g. /limits), confirming the handler registration is correct. Only the callback_query routing path fails in DM context.
Steps to reproduce
- Create a plugin that registers a command with inline buttons:
export default function (api: any) {
api.registerCommand({
name: "example",
description: "Test inline buttons",
acceptsArgs: true,
handler: (ctx: any) => {
const args = (ctx.args || "").trim();
console.log(`[example] handler invoked, args="${args}"`);
if (args === "action") {
return { text: "Action executed!" };
}
return {
text: "Choose an action:",
channelData: {
telegram: {
buttons: [[{ text: "Run Action", callback_data: "/example action" }]]
}
}
};
}
});
}
- In a Telegram group forum topic, type
/example → inline button appears → click "Run Action" → handler fires with args="action" ✅
- In a Telegram DM with the bot, type
/example → inline button appears → click "Run Action" → nothing happens ❌
Evidence from logs
Group topic — handler invoked on button click:
[provider-limits] args="run:status" from=telegram:group:-XXXXX:topic:19 to=telegram:-XXXXX messageThreadId=19
[provider-limits] args="send" from=telegram:group:-XXXXX:topic:19 to=telegram:-XXXXX messageThreadId=19
DM — handler invoked for typed command, but NOT for button click:
# Typed /limits in DM → handler fires:
[provider-limits] args="" from=telegram:XXXXX to=telegram:XXXXX messageThreadId=undefined
# Clicked inline button in DM → no log at all (handler never invoked)
Expected behavior
callback_query from inline buttons in DMs should route to the plugin's registerCommand handler, same as it does in group forum topics.
Environment
- OpenClaw version: 2026.2.26
- Channel: Telegram
- OS: macOS (darwin)
- Node: 22.x / 25.x (gateway subsystem)
- Bot config:
dmPolicy: "pairing", groupPolicy: "allowlist" (set at account level)
Summary
When a plugin registers a command via
api.registerCommand()and returns inline keyboard buttons (viachannelData.telegram.buttons), clicking those buttons works correctly in group forum topics but does nothing in DMs — the handler is never invoked and no log output appears.The command itself works fine in DMs when typed manually (e.g.
/limits), confirming the handler registration is correct. Only thecallback_queryrouting path fails in DM context.Steps to reproduce
/example→ inline button appears → click "Run Action" → handler fires withargs="action"✅/example→ inline button appears → click "Run Action" → nothing happens ❌Evidence from logs
Group topic — handler invoked on button click:
DM — handler invoked for typed command, but NOT for button click:
Expected behavior
callback_queryfrom inline buttons in DMs should route to the plugin'sregisterCommandhandler, same as it does in group forum topics.Environment
dmPolicy: "pairing",groupPolicy: "allowlist"(set at account level)