4.5.0 prevent users from claiming flags for multiple roles they have
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -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
@@ -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": {
|
||||||
|
|||||||
Reference in new issue
Block a user