File size: 1,220 Bytes
e5c9966 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | const { handleTicketButton } = require('../systems/tickets');
const { handleDropButton, handleDownloadButton } = require('../systems/drops');
const { handleMassDropInteraction } = require('../systems/massdrop');
module.exports = {
name: 'interactionCreate',
async execute(client, interaction) {
// Handle select menus and modals as well
if (!interaction.isButton() && !interaction.isStringSelectMenu() && !interaction.isModalSubmit()) return;
// Handle download buttons from server channels (dl_<assetId>)
if (interaction.isButton() && interaction.customId.startsWith('dl_')) {
await handleDownloadButton(interaction);
return;
}
// Try mass drop interactions (buttons, dropdowns, modals)
const massDropHandled = await handleMassDropInteraction(interaction);
if (massDropHandled) return;
// Try drop buttons first (DM interactions)
if (interaction.isButton()) {
const dropHandled = await handleDropButton(interaction);
if (dropHandled) return;
// Then ticket buttons (server interactions)
await handleTicketButton(interaction, client);
}
},
};
|