more mvp strip
This commit is contained in:
@@ -11,7 +11,6 @@ const { mongoose } = require('./db-connection');
|
||||
// Handlers
|
||||
const { handleButton, handleTicketModal } = require('./handlers/buttons');
|
||||
const { handleCommand, handleContextMenu, handleAutocomplete } = require('./handlers/commands');
|
||||
const { handleSetupButton, handleSetupModal, handleSetupSelect, PREFIX_BUTTON: SETUP_BUTTON_PREFIX, PREFIX_MODAL: SETUP_MODAL_PREFIX, PREFIX_SELECT: SETUP_SELECT_PREFIX } = require('./handlers/setup');
|
||||
const { handleDiscordReply } = require('./handlers/messages');
|
||||
|
||||
// Services & jobs
|
||||
@@ -113,30 +112,10 @@ async function runHandler(name, interaction, fn) {
|
||||
}
|
||||
|
||||
client.on('interactionCreate', async interaction => {
|
||||
if (interaction.isButton() && interaction.customId.startsWith(SETUP_BUTTON_PREFIX)) {
|
||||
try {
|
||||
const handled = await handleSetupButton(interaction);
|
||||
if (handled) return;
|
||||
} catch (err) {
|
||||
console.error('Setup button error:', err);
|
||||
logError('handleSetupButton', err, null, client).catch(() => {});
|
||||
await interaction.reply({
|
||||
content: `Setup error: ${err.message}. Try \`/setup\` again.`,
|
||||
ephemeral: true
|
||||
}).catch(() => {});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (interaction.isButton()) {
|
||||
return runHandler('handleButton', interaction, () => handleButton(interaction));
|
||||
}
|
||||
|
||||
if (interaction.isModalSubmit() && interaction.customId.startsWith(SETUP_MODAL_PREFIX)) {
|
||||
const handled = await runHandler('handleSetupModal', interaction, () => handleSetupModal(interaction));
|
||||
if (handled) return;
|
||||
}
|
||||
|
||||
if (interaction.isModalSubmit() && interaction.customId.startsWith('signature_modal_')) {
|
||||
// Handle signature modal submit
|
||||
try {
|
||||
@@ -176,11 +155,6 @@ client.on('interactionCreate', async interaction => {
|
||||
return runHandler('handleTicketModal', interaction, () => handleTicketModal(interaction));
|
||||
}
|
||||
|
||||
if (interaction.customId?.startsWith(SETUP_SELECT_PREFIX) && (interaction.isRoleSelectMenu() || interaction.isChannelSelectMenu())) {
|
||||
const handled = await runHandler('handleSetupSelect', interaction, () => handleSetupSelect(interaction));
|
||||
if (handled) return;
|
||||
}
|
||||
|
||||
if (interaction.isChatInputCommand()) {
|
||||
return runHandler('handleCommand', interaction, () => handleCommand(interaction));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user