blob: 62e96099df5353ededb707a16167edc6454a66af [file] [log] [blame]
pineafan63fc5e22022-08-04 22:04:10 +01001import { callback as roleMenu } from "../actions/roleMenu.js";
pineafan73a7c4a2022-07-24 10:38:04 +01002import verify from "../reflex/verify.js";
3import create from "../actions/tickets/create.js";
4import close from "../actions/tickets/delete.js";
5import createTranscript from "../premium/createTranscript.js";
PineaFana34d04b2023-01-03 22:05:42 +00006
PineaFan538d3752023-01-12 21:48:23 +00007import type { Interaction } from "discord.js";
PineaFan752af462022-12-31 21:59:38 +00008import type { NucleusClient } from "../utils/client.js";
pineafanad54d752022-04-18 19:01:43 +01009
pineafan63fc5e22022-08-04 22:04:10 +010010export const event = "interactionCreate";
pineafanad54d752022-04-18 19:01:43 +010011
pineafan02ba0232022-07-24 22:16:15 +010012
pineafan0f5cc782022-08-12 21:55:42 +010013async function interactionCreate(interaction: Interaction) {
PineaFana34d04b2023-01-03 22:05:42 +000014 if (interaction.isButton()) {
PineaFan538d3752023-01-12 21:48:23 +000015 switch (interaction.customId) {
16 case "rolemenu": { return await roleMenu(interaction); }
17 case "verifybutton": { return await verify(interaction); }
18 case "createticket": { return await create(interaction); }
19 case "closeticket": { return await close(interaction); }
20 case "createtranscript": { return await createTranscript(interaction); }
pineafan02ba0232022-07-24 22:16:15 +010021 }
PineaFana34d04b2023-01-03 22:05:42 +000022 // } else if (interaction.type === "APPLICATION_COMMAND_AUTOCOMPLETE") {
23 // const int = interaction as AutocompleteInteraction;
24 // switch (`${int.commandName} ${int.options.getSubcommandGroup(false)} ${int.options.getSubcommand(false)}`) {
PineaFana34d04b2023-01-03 22:05:42 +000025 // case "settings null stats": {
26 // return int.respond(generateStatsChannelAutocomplete(int.options.getString("name") ?? ""));
27 // }
28 // case "settings null welcome": {
29 // return int.respond(generateWelcomeMessageAutocomplete(int.options.getString("message") ?? ""));
30 // }
31 // }
pineafanad54d752022-04-18 19:01:43 +010032 }
33}
34
PineaFan752af462022-12-31 21:59:38 +000035export async function callback(_client: NucleusClient, interaction: Interaction) {
pineafan63fc5e22022-08-04 22:04:10 +010036 await interactionCreate(interaction);
Skyler Grey75ea9172022-08-06 10:22:23 +010037}