feat(cli): add channel create/edit/delete/move subcommands (#22512)
This commit is contained in:
parent
220bd95eff
commit
395b951efa
@ -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 <id>", "Guild id")
|
||||
.requiredOption("--name <name>", "Channel name"),
|
||||
)
|
||||
.option("--type <n>", "Channel type (0=text, 2=voice, 4=category, 15=forum)")
|
||||
.option("--parent-id <id>", "Parent category id")
|
||||
.option("--topic <text>", "Channel topic")
|
||||
.option("--position <n>", "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 <id>", "Channel id"),
|
||||
)
|
||||
.option("--name <name>", "New channel name")
|
||||
.option("--topic <text>", "New channel topic")
|
||||
.option("--position <n>", "Sort position")
|
||||
.option("--parent-id <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 <id>", "Channel id"),
|
||||
)
|
||||
.action(async (opts) => {
|
||||
await helpers.runMessageAction("channel-delete", opts);
|
||||
});
|
||||
|
||||
helpers
|
||||
.withMessageBase(
|
||||
channel
|
||||
.command("move")
|
||||
.description("Move a channel")
|
||||
.requiredOption("--guild-id <id>", "Guild id")
|
||||
.requiredOption("--channel-id <id>", "Channel id"),
|
||||
)
|
||||
.option("--parent-id <id>", "Target parent category id")
|
||||
.option("--position <n>", "Sort position")
|
||||
.action(async (opts) => {
|
||||
await helpers.runMessageAction("channel-move", opts);
|
||||
});
|
||||
|
||||
const member = message.command("member").description("Member actions");
|
||||
helpers
|
||||
.withMessageBase(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user