pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame^] | 1 | import { CommandInteraction } from "discord.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 2 | import { SlashCommandSubcommandBuilder } from "@discordjs/builders"; |
| 3 | import { WrappedCheck } from "jshaiku"; |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame^] | 4 | import create from "../../automations/tickets/create.js"; |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 5 | |
| 6 | const command = (builder: SlashCommandSubcommandBuilder) => |
| 7 | builder |
| 8 | .setName("create") |
| 9 | .setDescription("Creates a new modmail ticket") |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 10 | .addStringOption(option => option.setName("message").setDescription("The content of the ticket").setRequired(false)) |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 11 | |
pineafan | 1dc1572 | 2022-03-14 21:27:34 +0000 | [diff] [blame] | 12 | const callback = async (interaction: CommandInteraction) => { |
pineafan | 377794f | 2022-04-18 19:01:01 +0100 | [diff] [blame^] | 13 | await create(interaction) |
pineafan | 4f164f3 | 2022-02-26 22:07:12 +0000 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | const check = (interaction: CommandInteraction, defaultCheck: WrappedCheck) => { |
| 17 | return true; |
| 18 | } |
| 19 | |
| 20 | export { command }; |
| 21 | export { callback }; |
| 22 | export { check }; |