4.5.0 prevent users from claiming flags for multiple roles they have

This commit is contained in:
SowinskiBraeden committed 2022-12-11 11:13:17 -08:00
1 parent 42b4ee1cf6
commit 502e8cfc80
2 files changed
+11 -1

No files matched your search

+10
View File
@@ -36,6 +36,16 @@ module.exports = {
if (!interaction.member.roles.includes(args[0].value)) des = '**Notice:**\n> You cannot claim an armband for a role you don\'t have.'; if (!interaction.member.roles.includes(args[0].value)) des = '**Notice:**\n> You cannot claim an armband for a role you don\'t have.';
if (des) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(des)], flags: (1 << 6) }); if (des) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Yellow).setDescription(des)], flags: (1 << 6) });
for (let roleID in Object(GuildDB.factionArmbands)) {
if (interaction.member.roles.includes(roleID) && roleID != args[0].value) {
return interaction.send({ embeds: [
new EmbedBuilder()
.setColor(client.config.Colors.Yellow)
.setDescription('**Notice:**\n> You already have another role with a claimed flag.')
], flags: (1 << 6) })
}
}
// If this faction has an existing record in the db // If this faction has an existing record in the db
if (GuildDB.factionArmbands[args[0].value]) { if (GuildDB.factionArmbands[args[0].value]) {
const warnArmbadChange = new EmbedBuilder() const warnArmbadChange = new EmbedBuilder()
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayz-armbands", "name": "dayz-armbands",
"version": "4.4.3", "version": "4.5.0",
"description": "A Discord Bot to handle DayZ server flags and armbands for in game factions.", "description": "A Discord Bot to handle DayZ server flags and armbands for in game factions.",
"main": "index.js", "main": "index.js",
"nodemonConfig": { "nodemonConfig": {