From e30edf77d2cc27db97a6b6b1f845730c4924046c Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Thu, 14 Jul 2022 08:59:20 -0400 Subject: ticket --- src/commands/tickets/ticket-!.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/commands/tickets/ticket-!.ts (limited to 'src/commands/tickets/ticket-!.ts') diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts new file mode 100644 index 0000000..e69de29 -- cgit From 18ba8b2743c3cad7e89b70d0e1dcacacc007f6d6 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:11:08 -0400 Subject: wip tickets --- src/commands/tickets/ticket-!.ts | 63 +++++++++++++++++++++++++++++++++++ src/commands/tickets/ticket-create.ts | 0 2 files changed, 63 insertions(+) create mode 100644 src/commands/tickets/ticket-create.ts (limited to 'src/commands/tickets/ticket-!.ts') diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts index e69de29..7751df1 100644 --- a/src/commands/tickets/ticket-!.ts +++ b/src/commands/tickets/ticket-!.ts @@ -0,0 +1,63 @@ +import { BushCommand, clientSendAndPermCheck, deepWriteable, type SlashMessage } from '#lib'; +import { Flag, type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo'; +import { ApplicationCommandOptionType } from 'discord.js'; + +export const ticketSubcommands = deepWriteable({ + create: { + description: 'Create a ticket.', + type: ApplicationCommandOptionType.Subcommand, + options: [ + { + name: 'word', + description: 'What word do you want to highlight?', + retry: '{error} Enter a valid word.', + type: ApplicationCommandOptionType.String, + required: true + } + ] + } +} as const); + +export default class TicketCommand extends BushCommand { + public constructor() { + super('ticket', { + aliases: ['ticket'], + category: 'ticket', + description: 'Manage tickets.', + usage: ['ticket create '], + examples: ['ticket creates very cool ticket'], + slashOptions: Object.entries(ticketSubcommands).map( + ([subcommand, options]) => ({ name: subcommand, ...options } as SlashOption) + ), + slash: true, + channel: 'guild', + clientPermissions: (m) => clientSendAndPermCheck(m), + userPermissions: [] + }); + } + + public override *args(): ArgumentGeneratorReturn { + const subcommand: keyof typeof ticketSubcommands = yield { + id: 'subcommand', + type: Object.keys(ticketSubcommands), + prompt: { + start: 'What sub command would you like to use?', + retry: `{error} Valid subcommands are: ${Object.keys(ticketSubcommands) + .map((s) => `\`${s}\``) + .join()}.` + } + }; + + return Flag.continue(`ticket-${subcommand}`); + } + + public override async exec() { + throw new Error('This command is not meant to be executed directly.'); + } + + public override async execSlash(message: SlashMessage, args: { subcommand: string; subcommandGroup?: string }) { + // manual `Flag.continue` + const subcommand = this.handler.modules.get(`ticket-${args.subcommandGroup ?? args.subcommand}`)!; + return subcommand.exec(message, args); + } +} diff --git a/src/commands/tickets/ticket-create.ts b/src/commands/tickets/ticket-create.ts new file mode 100644 index 0000000..e69de29 -- cgit From 7824c911806e368f6a1bea7f6b55d1f470b755d1 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 5 Aug 2022 20:14:49 -0400 Subject: hide incomplete commands --- src/commands/moulberry-bush/neuRepo.ts | 5 +++-- src/commands/tickets/ticket-!.ts | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src/commands/tickets/ticket-!.ts') diff --git a/src/commands/moulberry-bush/neuRepo.ts b/src/commands/moulberry-bush/neuRepo.ts index 9d76810..d07ba53 100644 --- a/src/commands/moulberry-bush/neuRepo.ts +++ b/src/commands/moulberry-bush/neuRepo.ts @@ -43,10 +43,11 @@ export default class NeuRepoCommand extends BushCommand { slashType: ApplicationCommandOptionType.Boolean } */ ], - slash: true, + slash: false, clientPermissions: (m) => clientSendAndPermCheck(m, [PermissionFlagsBits.EmbedLinks], true), userPermissions: [], - ownerOnly: true + ownerOnly: true, + hidden: true }); } diff --git a/src/commands/tickets/ticket-!.ts b/src/commands/tickets/ticket-!.ts index 7751df1..6ec4093 100644 --- a/src/commands/tickets/ticket-!.ts +++ b/src/commands/tickets/ticket-!.ts @@ -29,10 +29,12 @@ export default class TicketCommand extends BushCommand { slashOptions: Object.entries(ticketSubcommands).map( ([subcommand, options]) => ({ name: subcommand, ...options } as SlashOption) ), - slash: true, + slash: false, channel: 'guild', clientPermissions: (m) => clientSendAndPermCheck(m), - userPermissions: [] + userPermissions: [], + ownerOnly: true, + hidden: true }); } -- cgit