fix(cli): route telegram thread create to topic-create

This commit is contained in:
Andy
2026-03-25 15:36:35 +08:00
committed by Ayaan Zaidi
parent 4140100807
commit e1cd90db6e
2 changed files with 22 additions and 1 deletions
+8 -1
View File
@@ -1,6 +1,11 @@
import type { Command } from "commander";
import type { MessageCliHelpers } from "./helpers.js";
function resolveThreadCreateAction(opts: { channel?: unknown }) {
const channel = typeof opts.channel === "string" ? opts.channel.trim().toLowerCase() : "";
return channel === "telegram" ? "topic-create" : "thread-create";
}
export function registerMessageThreadCommands(message: Command, helpers: MessageCliHelpers) {
const thread = message.command("thread").description("Thread actions");
@@ -17,7 +22,7 @@ export function registerMessageThreadCommands(message: Command, helpers: Message
.option("-m, --message <text>", "Initial thread message text")
.option("--auto-archive-min <n>", "Thread auto-archive minutes")
.action(async (opts) => {
await helpers.runMessageAction("thread-create", opts);
await helpers.runMessageAction(resolveThreadCreateAction(opts), opts);
});
helpers
@@ -53,3 +58,5 @@ export function registerMessageThreadCommands(message: Command, helpers: Message
await helpers.runMessageAction("thread-reply", opts);
});
}
export const __test__ = { resolveThreadCreateAction };