diff --git a/src/commands/slash/Main/hub/moderator.ts b/src/commands/slash/Main/hub/moderator.ts index 12413f3a..5fa2db3f 100644 --- a/src/commands/slash/Main/hub/moderator.ts +++ b/src/commands/slash/Main/hub/moderator.ts @@ -11,7 +11,7 @@ export default class Moderator extends HubCommand { const hub = (await this.hubService.findHubsByName(hubName)).at(0); const locale = await interaction.client.userManager.getUserLocale(interaction.user.id); - if (!hub || !(await hub?.isManager(interaction.user.id))) { + if (!hub || !(await hub.isManager(interaction.user.id))) { await this.replyEmbed(interaction, t('hub.notManager', locale, { emoji: emojis.no }), { ephemeral: true, }); diff --git a/src/managers/HubModeratorManager.ts b/src/managers/HubModeratorManager.ts index e9fb6bc6..cb25db29 100644 --- a/src/managers/HubModeratorManager.ts +++ b/src/managers/HubModeratorManager.ts @@ -5,6 +5,7 @@ import getRedis from '#main/utils/Redis.js'; import { handleError } from '#main/utils/Utils.js'; import { HubModerator, Role } from '@prisma/client'; import { Redis } from 'ioredis'; +import isEmpty from 'lodash/isEmpty.js'; export default class HubModeratorManager { private readonly hub: HubManager; @@ -64,7 +65,7 @@ export default class HubModeratorManager { async fetchAll() { const fromCache = await this.cache.hgetall(this.modsKey); - if (fromCache) { + if (!isEmpty(fromCache)) { return Object.values(fromCache).map((c) => JSON.parse(c)) as HubModerator[]; } diff --git a/src/utils/hub/edit.ts b/src/utils/hub/edit.ts index 161ec47a..d101bd9b 100644 --- a/src/utils/hub/edit.ts +++ b/src/utils/hub/edit.ts @@ -66,8 +66,8 @@ export const hubEmbed = async (hub: Hub, totalConnections: number, totalMods: nu `, ) - .setThumbnail(hub.iconUrl) - .setImage(hub.bannerUrl) + .setThumbnail(hub.iconUrl || null) + .setImage(hub.bannerUrl || null) .addFields( { name: 'Blacklists',