pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 1 | import { callback as roleMenu } from "../actions/roleMenu.js" |
| 2 | import verify from "../reflex/verify.js"; |
| 3 | import create from "../actions/tickets/create.js"; |
| 4 | import close from "../actions/tickets/delete.js"; |
| 5 | import createTranscript from "../premium/createTranscript.js"; |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 6 | |
| 7 | export const event = 'interactionCreate'; |
| 8 | |
| 9 | async 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) |
pineafan | 73a7c4a | 2022-07-24 10:38:04 +0100 | [diff] [blame] | 15 | if (interaction.customId === "createtranscript") return createTranscript(interaction) |
pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame] | 16 | } else if (interaction.componentType === "MESSAGE_COMPONENT") { |
| 17 | console.table(interaction) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export async function callback(client, interaction) { |
| 22 | await interactionCreate(interaction) |
| 23 | } |