diff options
-rw-r--r-- | src/commands/config/blacklist.ts | 4 | ||||
-rw-r--r-- | src/commands/info/userInfo.ts | 2 | ||||
-rw-r--r-- | src/lib/extensions/discord.js/BushGuild.ts | 7 | ||||
-rw-r--r-- | src/lib/utils/BushCache.ts | 4 | ||||
-rw-r--r-- | src/lib/utils/BushConstants.ts | 2 | ||||
-rw-r--r-- | src/tasks/updateCache.ts | 11 |
6 files changed, 16 insertions, 14 deletions
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts index ae19d70..5696c40 100644 --- a/src/commands/config/blacklist.ts +++ b/src/commands/config/blacklist.ts @@ -102,8 +102,8 @@ export default class BlacklistCommand extends BushCommand { }); // guild disable } else { - const blacklistedChannels = await message.guild.getSetting('blacklistedChannels')??[]; - const blacklistedUsers = await message.guild.getSetting('blacklistedUsers')??[]; + const blacklistedChannels = (await message.guild.getSetting('blacklistedChannels')) ?? []; + const blacklistedUsers = (await message.guild.getSetting('blacklistedUsers')) ?? []; if (action === 'toggle') { action = blacklistedChannels.includes(targetID) ?? blacklistedUsers.includes(targetID) ? 'unblacklist' : 'blacklist'; } diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index b9d59cc..7172c75 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -153,7 +153,7 @@ export default class UserInfoCommand extends BushCommand { } if (perms.length) userEmbed.addField('» Important Perms', perms.join(' ')); - if (emojis) userEmbed.setDescription(''/*zero width space*/+emojis.join(' ')); + if (emojis) userEmbed.setDescription('' /*zero width space*/ + emojis.join(' ')); return await message.util.reply({ embeds: [userEmbed] }); } diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts index 9b528c6..79f7c98 100644 --- a/src/lib/extensions/discord.js/BushGuild.ts +++ b/src/lib/extensions/discord.js/BushGuild.ts @@ -12,13 +12,16 @@ export class BushGuild extends Guild { } public async getSetting<K extends keyof GuildModel>(setting: K): Promise<GuildModel[K]> { - return this.client.cache.guilds.get(this.id)?.[setting] ?? ((await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id }))[setting]; + return ( + this.client.cache.guilds.get(this.id)?.[setting] ?? + ((await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id }))[setting] + ); } public async setSetting<K extends keyof GuildModel>(setting: K, value: GuildDB[K]): Promise<GuildDB> { const row = (await GuildDB.findByPk(this.id)) ?? GuildDB.build({ id: this.id }); row[setting] = value; - this.client.cache.guilds.set(this.id, row.toJSON() as GuildDB) + this.client.cache.guilds.set(this.id, row.toJSON() as GuildDB); return await row.save(); } diff --git a/src/lib/utils/BushCache.ts b/src/lib/utils/BushCache.ts index 95c2346..f9def5e 100644 --- a/src/lib/utils/BushCache.ts +++ b/src/lib/utils/BushCache.ts @@ -9,9 +9,7 @@ class GlobalCache { public static blacklistedUsers = new Array<Snowflake>(); } - export class BushCache { public static global = GlobalCache; - // eslint-disable-next-line @typescript-eslint/ban-types - public static guilds = new Collection<Snowflake, Guild>() + public static guilds = new Collection<Snowflake, Guild>(); } diff --git a/src/lib/utils/BushConstants.ts b/src/lib/utils/BushConstants.ts index 2d05425..5a99798 100644 --- a/src/lib/utils/BushConstants.ts +++ b/src/lib/utils/BushConstants.ts @@ -81,7 +81,7 @@ export class BushConstants { REQUEST_TO_SPEAK: { name: 'Request to Speak', important: false }, USE_PUBLIC_THREADS: { name: 'Use public Threads', important: false }, USE_PRIVATE_THREADS: { name: 'Use Private Threads', important: false }, - MANAGE_THREADS: { name: 'Manage Threads', important: true} + MANAGE_THREADS: { name: 'Manage Threads', important: true } }, features: { diff --git a/src/tasks/updateCache.ts b/src/tasks/updateCache.ts index 1a17aef..404173b 100644 --- a/src/tasks/updateCache.ts +++ b/src/tasks/updateCache.ts @@ -24,8 +24,8 @@ export class UpdateCacheTask extends BushTask { private static async updateGlobalCache(client: BushClient): Promise<void> { const environment = config.environment; - const row = - ((await Global.findByPk(environment)) || + const row = ( + (await Global.findByPk(environment)) || (await Global.create({ environment, superUsers: [], @@ -33,7 +33,8 @@ export class UpdateCacheTask extends BushTask { blacklistedGuilds: [], blacklistedUsers: [], disabledCommands: [] - }))).toJSON() + })) + ).toJSON(); for (const option in row) { if (Object.keys(client.cache.global).includes(option)) client.cache.global[option] = row[option]; @@ -42,8 +43,8 @@ export class UpdateCacheTask extends BushTask { private static async updateGuildCache(client: BushClient): Promise<void> { const rows = await Guild.findAll(); - for (const row of rows){ - client.cache.guilds.set(row.id, row.toJSON() as Guild) + for (const row of rows) { + client.cache.guilds.set(row.id, row.toJSON() as Guild); } } } |