4.1.4 check excluded list before claim

This commit is contained in:
SowinskiBraeden committed 2022-12-07 17:31:26 -08:00
1 parent c9cf1ff851
commit b2cd38f9e5
2 files changed
+7 -7

No files matched your search

+6 -6
View File
@@ -27,13 +27,13 @@ module.exports = {
* @param {*} param3 * @param {*} param3
*/ */
run: async (client, interaction, args, { GuildDB }) => { run: async (client, interaction, args, { GuildDB }) => {
if (!interaction.member.roles.includes(args[0].value)) {
const invalidRoleEmbed = new EmbedBuilder()
.setColor(client.config.Colors.Yellow)
.setDescription('**Notice:**\n> You cannot claim an armband for a role you don\'t have.');
return interaction.send({ embeds: [invalidRoleEmbed], flags: (1 << 6) }); let des;
}
if (GuildDB.excludedRoles.includes(args[0].value)) des = '**Notice:**\n> This role has been configured to be excluded to claim an armband.';
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 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]) {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "dayz-armbands", "name": "dayz-armbands",
"version": "4.1.3", "version": "4.1.4",
"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": {