Skip to content

Commit

Permalink
fix: hub moderator check hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Dec 14, 2024
1 parent d07415a commit 213fe4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/commands/slash/Main/hub/moderator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
3 changes: 2 additions & 1 deletion src/managers/HubModeratorManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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[];
}

Expand Down
4 changes: 2 additions & 2 deletions src/utils/hub/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 213fe4d

Please sign in to comment.