wsb-bot / src /events /interactionCreate.js
APRK01
feat: private download system β€” interactive buttons with ephemeral temp URLs
46592dd
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);
}
},
};