Skip to content

Commit 29a4696

Browse files
committed
fix: preserve /start and /reset bot commands in telegram adapter
The old monolithic telegram-bridge.js handled these locally. Without them, the commands get forwarded to the agent as prompts.
1 parent b970dcf commit 29a4696

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎scripts/adapters/messaging/telegram.js‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,25 @@ module.exports = function createAdapter(config) {
7272

7373
const userName = msg.from?.first_name || "someone";
7474

75+
// Handle bot commands locally — these existed in the
76+
// monolithic telegram-bridge.js and users may depend on them.
77+
if (msg.text === "/start") {
78+
await tgApi("sendMessage", {
79+
chat_id: channelId,
80+
text: "NemoClaw — powered by Nemotron\n\nSend me a message and I'll run it through the OpenClaw agent inside an OpenShell sandbox.",
81+
reply_to_message_id: msg.message_id,
82+
}).catch(() => {});
83+
continue;
84+
}
85+
if (msg.text === "/reset") {
86+
await tgApi("sendMessage", {
87+
chat_id: channelId,
88+
text: "Session reset.",
89+
reply_to_message_id: msg.message_id,
90+
}).catch(() => {});
91+
continue;
92+
}
93+
7594
await onMessage({
7695
channelId,
7796
userName,

0 commit comments

Comments
 (0)