Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit 213fe4d

Browse files
committed
fix: hub moderator check hotfix
1 parent d07415a commit 213fe4d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/commands/slash/Main/hub/moderator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default class Moderator extends HubCommand {
1111
const hub = (await this.hubService.findHubsByName(hubName)).at(0);
1212

1313
const locale = await interaction.client.userManager.getUserLocale(interaction.user.id);
14-
if (!hub || !(await hub?.isManager(interaction.user.id))) {
14+
if (!hub || !(await hub.isManager(interaction.user.id))) {
1515
await this.replyEmbed(interaction, t('hub.notManager', locale, { emoji: emojis.no }), {
1616
ephemeral: true,
1717
});

src/managers/HubModeratorManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import getRedis from '#main/utils/Redis.js';
55
import { handleError } from '#main/utils/Utils.js';
66
import { HubModerator, Role } from '@prisma/client';
77
import { Redis } from 'ioredis';
8+
import isEmpty from 'lodash/isEmpty.js';
89

910
export default class HubModeratorManager {
1011
private readonly hub: HubManager;
@@ -64,7 +65,7 @@ export default class HubModeratorManager {
6465

6566
async fetchAll() {
6667
const fromCache = await this.cache.hgetall(this.modsKey);
67-
if (fromCache) {
68+
if (!isEmpty(fromCache)) {
6869
return Object.values(fromCache).map((c) => JSON.parse(c)) as HubModerator[];
6970
}
7071

src/utils/hub/edit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ export const hubEmbed = async (hub: Hub, totalConnections: number, totalMods: nu
6666
6767
`,
6868
)
69-
.setThumbnail(hub.iconUrl)
70-
.setImage(hub.bannerUrl)
69+
.setThumbnail(hub.iconUrl || null)
70+
.setImage(hub.bannerUrl || null)
7171
.addFields(
7272
{
7373
name: 'Blacklists',

0 commit comments

Comments
 (0)