Database improvements

This commit is contained in:
Isaac
2021-05-30 20:39:14 +01:00
parent c91a8c5b0c
commit 461d535102
7 changed files with 25 additions and 30 deletions

View File

@@ -59,7 +59,7 @@ module.exports = class BlacklistCommand extends Command {
id = role.id;
} else if (/\d{17,19}/.test(input)) {
id = input;
} else if (settings.blacklist?.length === 0) {
} else if (settings.blacklist.length === 0) {
return await message.channel.send(
new MessageEmbed()
.setColor(settings.colour)
@@ -69,7 +69,7 @@ module.exports = class BlacklistCommand extends Command {
);
} else {
// list blacklisted members
const blacklist = settings.blacklist?.map(element => {
const blacklist = settings.blacklist.map(element => {
const is_role = message.guild.roles.cache.has(element);
if (is_role) return `» <@&${element}> (\`${element}\`)`;
else return `» <@${element}> (\`${element}\`)`;
@@ -85,7 +85,7 @@ module.exports = class BlacklistCommand extends Command {
const is_role = role !== undefined || message.guild.roles.cache.has(id);
const member_or_role = is_role ? 'role' : 'member';
const index = settings.blacklist?.findIndex(element => element === id);
const index = settings.blacklist.findIndex(element => element === id);
const new_blacklist = [...settings.blacklist];