mirror of https://github.com/clickscodes/nucleus
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.7 KiB
38 lines
1.7 KiB
import { callback as roleMenu } from "../actions/roleMenu.js";
|
|
import verify from "../reflex/verify.js";
|
|
import create from "../actions/tickets/create.js";
|
|
import close from "../actions/tickets/delete.js";
|
|
import createTranscript from "../premium/createTranscript.js";
|
|
|
|
import type { Interaction } from "discord.js";
|
|
import type { NucleusClient } from "../utils/client.js";
|
|
|
|
export const event = "interactionCreate";
|
|
|
|
|
|
async function interactionCreate(interaction: Interaction) {
|
|
if (interaction.isButton()) {
|
|
switch (interaction.customId) {
|
|
case "rolemenu": { return await roleMenu(interaction); }
|
|
case "verifybutton": { return await verify(interaction); }
|
|
case "createticket": { return await create(interaction); }
|
|
case "closeticket": { return await close(interaction); }
|
|
case "createtranscript": { return await createTranscript(interaction); }
|
|
}
|
|
// } else if (interaction.type === "APPLICATION_COMMAND_AUTOCOMPLETE") {
|
|
// const int = interaction as AutocompleteInteraction;
|
|
// switch (`${int.commandName} ${int.options.getSubcommandGroup(false)} ${int.options.getSubcommand(false)}`) {
|
|
// case "settings null stats": {
|
|
// return int.respond(generateStatsChannelAutocomplete(int.options.getString("name") ?? ""));
|
|
// }
|
|
// case "settings null welcome": {
|
|
// return int.respond(generateWelcomeMessageAutocomplete(int.options.getString("message") ?? ""));
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
export async function callback(_client: NucleusClient, interaction: Interaction) {
|
|
await interactionCreate(interaction);
|
|
}
|