opencode-telegram-mirror 0.5.1 → 0.6.0
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/package.json +1 -1
- package/src/main.ts +16 -2
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -289,6 +289,7 @@ async function main() {
|
|
|
289
289
|
{ command: "build", description: "Switch to build mode" },
|
|
290
290
|
{ command: "review", description: "Review changes [commit|branch|pr]" },
|
|
291
291
|
{ command: "rename", description: "Rename the session" },
|
|
292
|
+
{ command: "version", description: "Show mirror bot version" },
|
|
292
293
|
])
|
|
293
294
|
if (commandsResult.status === "error") {
|
|
294
295
|
log("warn", "Failed to set bot commands", { error: commandsResult.error.message })
|
|
@@ -767,6 +768,19 @@ async function handleTelegramMessage(
|
|
|
767
768
|
return
|
|
768
769
|
}
|
|
769
770
|
|
|
771
|
+
if (messageText?.trim() === "/version") {
|
|
772
|
+
const pkg = await import("../package.json")
|
|
773
|
+
const sendResult = await state.telegram.sendMessage(
|
|
774
|
+
`opencode-telegram-mirror v${pkg.version}`
|
|
775
|
+
)
|
|
776
|
+
if (sendResult.status === "error") {
|
|
777
|
+
log("error", "Failed to send version response", {
|
|
778
|
+
error: sendResult.error.message,
|
|
779
|
+
})
|
|
780
|
+
}
|
|
781
|
+
return
|
|
782
|
+
}
|
|
783
|
+
|
|
770
784
|
if (messageText?.trim() === "/interrupt") {
|
|
771
785
|
log("info", "Received /interrupt command")
|
|
772
786
|
if (state.sessionId) {
|
|
@@ -859,7 +873,7 @@ async function handleTelegramMessage(
|
|
|
859
873
|
})
|
|
860
874
|
|
|
861
875
|
// Check for freetext answer
|
|
862
|
-
const threadId = state.threadId ??
|
|
876
|
+
const threadId = state.threadId ?? null
|
|
863
877
|
|
|
864
878
|
if (isAwaitingFreetext(msg.chat.id, threadId) && messageText) {
|
|
865
879
|
const result = await handleFreetextAnswer({
|
|
@@ -1470,7 +1484,7 @@ async function handleOpenCodeEvent(state: BotState, ev: OpenCodeEvent) {
|
|
|
1470
1484
|
}
|
|
1471
1485
|
}
|
|
1472
1486
|
|
|
1473
|
-
const threadId = state.threadId ??
|
|
1487
|
+
const threadId = state.threadId ?? null
|
|
1474
1488
|
|
|
1475
1489
|
if (ev.type === "question.asked") {
|
|
1476
1490
|
await showQuestionButtons({
|