Fixed Invite Accordion

This commit is contained in:
2025-10-10 05:12:54 -04:00
parent 900ce85e2c
commit 8236c1e0e7
7 changed files with 219 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
const api = require('../api');
module.exports = {
name: 'inviteDelete',
async execute(invite) {
try {
const guildId = invite.guild.id;
const code = invite.code;
// Remove from database
await api.deleteInvite(guildId, code);
// Publish SSE event for real-time frontend updates
const bot = require('..');
if (bot && bot.publishEvent) {
bot.publishEvent(guildId, 'inviteDeleted', {
code: code
});
}
} catch (error) {
console.error('Error handling inviteDelete:', error);
}
}
};