pineafan | ad54d75 | 2022-04-18 19:01:43 +0100 | [diff] [blame^] | 1 | import { callback as roleMenu } from "../automations/roleMenu.js" |
| 2 | import verify from "../automations/verify.js"; |
| 3 | import create from "../automations/tickets/create.js"; |
| 4 | import close from "../automations/tickets/delete.js"; |
| 5 | |
| 6 | export const event = 'interactionCreate'; |
| 7 | |
| 8 | async function interactionCreate(interaction) { |
| 9 | if (interaction.componentType === "BUTTON") { |
| 10 | if (interaction.customId === "rolemenu") return await roleMenu(interaction) |
| 11 | if (interaction.customId === "verifybutton") return verify(interaction) |
| 12 | if (interaction.customId === "createticket") return create(interaction) |
| 13 | if (interaction.customId === "closeticket") return close(interaction) |
| 14 | } else if (interaction.componentType === "MESSAGE_COMPONENT") { |
| 15 | console.table(interaction) |
| 16 | } |
| 17 | } |
| 18 | |
| 19 | export async function callback(client, interaction) { |
| 20 | await interactionCreate(interaction) |
| 21 | } |