mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-06 18:21:25 +03:00
Database improvements
This commit is contained in:
@@ -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];
|
||||
|
||||
|
Reference in New Issue
Block a user