refactor(src): split oversized modules
This commit is contained in:
28
src/cli/program/message/register.poll.ts
Normal file
28
src/cli/program/message/register.poll.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { Command } from "commander";
|
||||
import { collectOption } from "../helpers.js";
|
||||
import type { MessageCliHelpers } from "./helpers.js";
|
||||
|
||||
export function registerMessagePollCommand(
|
||||
message: Command,
|
||||
helpers: MessageCliHelpers,
|
||||
) {
|
||||
helpers
|
||||
.withMessageBase(
|
||||
helpers.withRequiredMessageTarget(
|
||||
message.command("poll").description("Send a poll"),
|
||||
),
|
||||
)
|
||||
.requiredOption("--poll-question <text>", "Poll question")
|
||||
.option(
|
||||
"--poll-option <choice>",
|
||||
"Poll option (repeat 2-12 times)",
|
||||
collectOption,
|
||||
[] as string[],
|
||||
)
|
||||
.option("--poll-multi", "Allow multiple selections", false)
|
||||
.option("--poll-duration-hours <n>", "Poll duration (Discord)")
|
||||
.option("-m, --message <text>", "Optional message body")
|
||||
.action(async (opts) => {
|
||||
await helpers.runMessageAction("poll", opts);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user