import type { Command } from "commander"; import type { MessageCliHelpers } from "./helpers.js"; import { collectOption } from "../helpers.js"; export function registerMessageEmojiCommands(message: Command, helpers: MessageCliHelpers) { const emoji = message.command("emoji").description("Emoji actions"); helpers .withMessageBase(emoji.command("list").description("List emojis")) .option("--guild-id ", "Guild id (Discord)") .action(async (opts) => { await helpers.runMessageAction("emoji-list", opts); }); helpers .withMessageBase( emoji .command("upload") .description("Upload an emoji") .requiredOption("--guild-id ", "Guild id"), ) .requiredOption("--emoji-name ", "Emoji name") .requiredOption("--media ", "Emoji media (path or URL)") .option("--role-ids ", "Role id (repeat)", collectOption, [] as string[]) .action(async (opts) => { await helpers.runMessageAction("emoji-upload", opts); }); } export function registerMessageStickerCommands(message: Command, helpers: MessageCliHelpers) { const sticker = message.command("sticker").description("Sticker actions"); helpers .withMessageBase( helpers.withRequiredMessageTarget(sticker.command("send").description("Send stickers")), ) .requiredOption("--sticker-id ", "Sticker id (repeat)", collectOption) .option("-m, --message ", "Optional message body") .action(async (opts) => { await helpers.runMessageAction("sticker", opts); }); helpers .withMessageBase( sticker .command("upload") .description("Upload a sticker") .requiredOption("--guild-id ", "Guild id"), ) .requiredOption("--sticker-name ", "Sticker name") .requiredOption("--sticker-desc ", "Sticker description") .requiredOption("--sticker-tags ", "Sticker tags") .requiredOption("--media ", "Sticker media (path or URL)") .action(async (opts) => { await helpers.runMessageAction("sticker-upload", opts); }); }