blob: 1fd1e1f45c3e62ff52ce0f5dc31a51396785fc69 [file] [log] [blame]
pineafan73a7c4a2022-07-24 10:38:04 +01001import { callback as roleMenu } from "../actions/roleMenu.js"
2import 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";
pineafanad54d752022-04-18 19:01:43 +01006
7export const event = 'interactionCreate';
8
9async function interactionCreate(interaction) {
10 if (interaction.componentType === "BUTTON") {
11 if (interaction.customId === "rolemenu") return await roleMenu(interaction)
12 if (interaction.customId === "verifybutton") return verify(interaction)
13 if (interaction.customId === "createticket") return create(interaction)
14 if (interaction.customId === "closeticket") return close(interaction)
pineafan73a7c4a2022-07-24 10:38:04 +010015 if (interaction.customId === "createtranscript") return createTranscript(interaction)
pineafanad54d752022-04-18 19:01:43 +010016 } else if (interaction.componentType === "MESSAGE_COMPONENT") {
17 console.table(interaction)
18 }
19}
20
21export async function callback(client, interaction) {
22 await interactionCreate(interaction)
23}