event delete handler
This commit is contained in:
2 files changed
+14
-1
No files matched your search
@@ -134,8 +134,21 @@ module.exports = {
|
|||||||
if (!interaction.customId.endsWith(interaction.member.user.id))
|
if (!interaction.customId.endsWith(interaction.member.user.id))
|
||||||
return interaction.reply({ content: 'This interaction is not for you', flags: (1 << 6) });
|
return interaction.reply({ content: 'This interaction is not for you', flags: (1 << 6) });
|
||||||
|
|
||||||
|
let event = GuildDB.events.find(e => e.name == interaction.values[0]);
|
||||||
|
|
||||||
|
client.dbo.collection('guilds').updateOne({ 'server.serverID': GuildDB.serverID }, {
|
||||||
|
$pull: {
|
||||||
|
'server.events': event,
|
||||||
|
}
|
||||||
|
}, function (err, res) {
|
||||||
|
if (err) return client.sendInternalError(interaction, err);
|
||||||
|
});
|
||||||
|
|
||||||
|
let successEmbed = new EmbedBuilder()
|
||||||
|
.setColor(client.config.Colors.Green)
|
||||||
|
.setDescription(`**Success:** Successfully Deleted **${event.name} Event**`);
|
||||||
|
|
||||||
|
return interaction.update({ embeds: [successEmbed], components: [] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayz-armbands",
|
"name": "dayz-armbands",
|
||||||
"version": "8.0.5",
|
"version": "8.1.0",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
Reference in new issue
Block a user