13.1.5 debug /search command and /config only_officers_search configuration

This commit is contained in:
SowinskiBraeden committed 2022-10-25 12:21:31 -07:00
1 parent 206972b487
commit 5317e96a48
3 files changed
+10 -7

No files matched your search

+3 -4
View File
@@ -825,12 +825,11 @@ module.exports = {
}
} else if (args[0].name == 'only_officers_search') {
const setting = args[0].options[0];
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.onlyOfficersSearch": setting}}, function(err, res) {
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.onlyOfficersSearch": args[0].options[0].value}}, function(err, res) {
if (err) return client.sendInternalError(interaction, err);
});
const title = setting ? 'True: Only officers can use /search' : 'False: Any user can use /search';
let title = args[0].options[0].value ? 'True: Only officers can use /search' : 'False: Any user can use /search';
const successEmbed = new EmbedBuilder()
.setColor(client.config.Colors.Green)
@@ -838,7 +837,7 @@ module.exports = {
return interaction.send({ embeds: [successEmbed] });
} else if (args[0].name == 'casino_multiplier') {
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.casinoMultiplier": args[0].options[0]}}, function(err, res) {
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.casinoMultiplier": args[0].options[0].value}}, function(err, res) {
if (err) return client.sendInternalError(interaction, err);
});
+6 -2
View File
@@ -39,8 +39,12 @@ module.exports = {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
if (GuildDB.onlyOfficersSearch && client.exists(GuildDB.officerRole) && !interaction.member.roles.includes(GuildDB.officerRole)) {
if (GuildDB.onlyOfficersSearch && !client.exists(GuildDB.officerRole)) {
return interaction.send({ content: 'The officer role is required to use this command but has not been configured for this server.' });
}
if (GuildDB.onlyOfficersSearch && !interaction.member.roles.includes(GuildDB.officerRole)) {
return interaction.send({ content: 'You don\'t have the permissions to use this command.' });
}
+1 -1
View File
@@ -2,7 +2,7 @@ require('dotenv').config();
module.exports = {
Dev: "PROD.",
Version: "13.1.4", // (major).(feature).(revision/bug/refactoring)
Version: "13.1.5", // (major).(feature).(revision/bug/refactoring)
Admins: ["362791661274660874", "329371697570381824"], // Admins of the bot
DefaultPrefix: "?",
ServerID: "955668596745461830",