pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 1 | import { CommandInteraction } from "discord.js"; |
| 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 4 | import { ChannelType } from 'discord-api-types'; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 5 | |
| 6 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 7 | builder |
| 8 | .setName("tickets") |
| 9 | .setDescription("Shows settings for tickets") |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 10 | .addStringOption(option => option.setName("enabled").setDescription("If users should be able to create tickets | Default yes").setRequired(false) |
| 11 | .addChoices([["Yes", "yes"], ["No", "no"]])) |
| 12 | .addChannelOption(option => option.setName("category").setDescription("The category where tickets are created").addChannelType(ChannelType.GuildCategory).setRequired(false)) |
| 13 | .addNumberOption(option => option.setName("maxtickets").setDescription("The maximum amount of tickets a user can create | Default 5").setRequired(false).setMinValue(1)) |
| 14 | .addRoleOption(option => option.setName("supportping").setDescription("The role pinged when a ticket is created").setRequired(false)) |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 15 | |
| 16 | const callback = (interaction: CommandInteraction) => { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame] | 17 | interaction.reply("This command is not yet finished [settings/tickets]"); |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 21 | return interaction.memberPermissions.has("MANAGE_GUILD"); |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 22 | } |
| 23 | |
| 24 | export { command }; |
| 25 | export { callback }; |
| 26 | export { check }; |