exclude roles featrue
This commit is contained in:
2 files changed
+53
-1
No files matched your search
+51
-1
@@ -1,4 +1,4 @@
|
|||||||
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = require('discord.js');
|
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Embed } = require('discord.js');
|
||||||
const bitfieldCalculator = require('discord-bitfield-calculator');
|
const bitfieldCalculator = require('discord-bitfield-calculator');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -75,6 +75,31 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "exclude_role",
|
||||||
|
description: "Exclude roles from users to use to claim a flag.",
|
||||||
|
value: "exclude_role",
|
||||||
|
type: 1,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "add_or_remove",
|
||||||
|
description: "Add or remove a role from the exclude list.",
|
||||||
|
value: "add_or_remove",
|
||||||
|
type: 3,
|
||||||
|
choices: [
|
||||||
|
{ name: 'add', value: 'add' }, { name: 'remove', value: 'remove' },
|
||||||
|
],
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "role",
|
||||||
|
description: "The role to manage",
|
||||||
|
value: "role",
|
||||||
|
type: 8,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "reset",
|
name: "reset",
|
||||||
description: "Restore all settings to default configurations",
|
description: "Restore all settings to default configurations",
|
||||||
@@ -189,6 +214,31 @@ module.exports = {
|
|||||||
return interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
|
return interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (args[0].name == 'exclude') {
|
||||||
|
|
||||||
|
if (args[0].options[0].value == 'add') {
|
||||||
|
client.dbo.collection('guilds').updateOne({'server.serverID': GuildDB.serverID}, {$push: {'server.excludedRoles': args[0].options[1].value}}, function(err, res) {
|
||||||
|
if (err) return client.sendInternalError(interaction, err);
|
||||||
|
})
|
||||||
|
|
||||||
|
const success = new EmbedBuilder()
|
||||||
|
.setColor(client.config.Colors.Green)
|
||||||
|
.setDescription(`**Done!**\n> Successfully added <@&${args[0].options[1].value}> to list of excluded roles.`)
|
||||||
|
|
||||||
|
return interaction.send({ embeds: [success] });
|
||||||
|
|
||||||
|
} else if (args[0].options[0].value == 'remove') {
|
||||||
|
client.dbo.collection('guilds').updateOne({'server.serverID': GuildDB.serverID}, {$pull: {'server.excludedRoles': args[0].options[1].value}}, function(err, res) {
|
||||||
|
if (err) return client.sendInternalError(interaction, err);
|
||||||
|
})
|
||||||
|
|
||||||
|
const success = new EmbedBuilder()
|
||||||
|
.setColor(client.config.Colors.Green)
|
||||||
|
.setDescription(`**Done!**\n> Successfully removed <@&${args[0].options[1].value}> to list of excluded roles.`)
|
||||||
|
|
||||||
|
return interaction.send({ embeds: [success] });
|
||||||
|
}
|
||||||
|
|
||||||
} else if (args[0].name == 'reset') {
|
} else if (args[0].name == 'reset') {
|
||||||
const prompt = new EmbedBuilder()
|
const prompt = new EmbedBuilder()
|
||||||
.setTitle(`Woah!? Hold on.`)
|
.setTitle(`Woah!? Hold on.`)
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ class DayzArmbands extends Client {
|
|||||||
allowedChannels: [],
|
allowedChannels: [],
|
||||||
factionArmbands: {},
|
factionArmbands: {},
|
||||||
usedArmbands: [],
|
usedArmbands: [],
|
||||||
|
excludedRoles: [],
|
||||||
botAdmin: null,
|
botAdmin: null,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,6 +221,7 @@ class DayzArmbands extends Client {
|
|||||||
allowedChannels: guild.server.allowedChannels,
|
allowedChannels: guild.server.allowedChannels,
|
||||||
factionArmbands: guild.server.factionArmbands,
|
factionArmbands: guild.server.factionArmbands,
|
||||||
usedArmbands: guild.server.usedArmbands,
|
usedArmbands: guild.server.usedArmbands,
|
||||||
|
excludedRoles: guild.server.excludedRoles,
|
||||||
botAdmin: guild.server.botAdmin,
|
botAdmin: guild.server.botAdmin,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user