opencode-telegram-bot 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18613,10 +18613,12 @@ async function startTelegram(options) {
|
|
|
18613
18613
|
if (!name)
|
|
18614
18614
|
continue;
|
|
18615
18615
|
opencodeCommands.add(name);
|
|
18616
|
-
|
|
18616
|
+
console.log(`[Telegram] Found OpenCode command: ${name}`);
|
|
18617
|
+
if (!isHiddenOpenCodeCommand(name) && /^[a-z0-9_]{1,32}$/.test(name)) {
|
|
18618
|
+
const desc = cmd.description || "OpenCode command";
|
|
18617
18619
|
opencodeCommandMenu.push({
|
|
18618
18620
|
command: name,
|
|
18619
|
-
description:
|
|
18621
|
+
description: desc.length > 256 ? desc.slice(0, 253) + "..." : desc,
|
|
18620
18622
|
});
|
|
18621
18623
|
}
|
|
18622
18624
|
}
|
|
@@ -20104,9 +20106,10 @@ async function startTelegram(options) {
|
|
|
20104
20106
|
});
|
|
20105
20107
|
if (options.launch !== false) {
|
|
20106
20108
|
try {
|
|
20107
|
-
// Start the bot
|
|
20109
|
+
// Start the bot — launch() returns a promise that resolves only
|
|
20110
|
+
// when polling stops, so we log before awaiting it.
|
|
20111
|
+
console.log("[Telegram] Bot is running (long-polling started)");
|
|
20108
20112
|
await bot.launch();
|
|
20109
|
-
console.log("[Telegram] Bot is running");
|
|
20110
20113
|
// Enable graceful stop
|
|
20111
20114
|
process.once("SIGINT", () => bot.stop("SIGINT"));
|
|
20112
20115
|
process.once("SIGTERM", () => bot.stop("SIGTERM"));
|