From 395b951efafe91cbb8e0a7075a5d1edd53f6733d Mon Sep 17 00:00:00 2001 From: yinghaosang Date: Sat, 21 Feb 2026 18:39:02 +0800 Subject: [PATCH] feat(cli): add channel create/edit/delete/move subcommands (#22512) --- .../program/message/register.discord-admin.ts | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/cli/program/message/register.discord-admin.ts b/src/cli/program/message/register.discord-admin.ts index de806dfede9..71907c3d743 100644 --- a/src/cli/program/message/register.discord-admin.ts +++ b/src/cli/program/message/register.discord-admin.ts @@ -57,6 +57,64 @@ export function registerMessageDiscordAdminCommands(message: Command, helpers: M await helpers.runMessageAction("channel-list", opts); }); + helpers + .withMessageBase( + channel + .command("create") + .description("Create a channel") + .requiredOption("--guild-id ", "Guild id") + .requiredOption("--name ", "Channel name"), + ) + .option("--type ", "Channel type (0=text, 2=voice, 4=category, 15=forum)") + .option("--parent-id ", "Parent category id") + .option("--topic ", "Channel topic") + .option("--position ", "Sort position") + .option("--nsfw", "Mark as NSFW") + .action(async (opts) => { + await helpers.runMessageAction("channel-create", opts); + }); + + helpers + .withMessageBase( + channel + .command("edit") + .description("Edit a channel") + .requiredOption("--channel-id ", "Channel id"), + ) + .option("--name ", "New channel name") + .option("--topic ", "New channel topic") + .option("--position ", "Sort position") + .option("--parent-id ", "Parent category id") + .option("--nsfw", "Mark as NSFW") + .action(async (opts) => { + await helpers.runMessageAction("channel-edit", opts); + }); + + helpers + .withMessageBase( + channel + .command("delete") + .description("Delete a channel") + .requiredOption("--channel-id ", "Channel id"), + ) + .action(async (opts) => { + await helpers.runMessageAction("channel-delete", opts); + }); + + helpers + .withMessageBase( + channel + .command("move") + .description("Move a channel") + .requiredOption("--guild-id ", "Guild id") + .requiredOption("--channel-id ", "Channel id"), + ) + .option("--parent-id ", "Target parent category id") + .option("--position ", "Sort position") + .action(async (opts) => { + await helpers.runMessageAction("channel-move", opts); + }); + const member = message.command("member").description("Member actions"); helpers .withMessageBase(