diff --git a/src/ChannelHandler.ts b/src/ChannelHandler.ts index 0b170b4..374036a 100644 --- a/src/ChannelHandler.ts +++ b/src/ChannelHandler.ts @@ -247,7 +247,7 @@ class ChannelHandler if (!user) return reject(new Error('Failed to find user')); const mem = await this.modmail.getMember(user.id).catch(this.logger.error.bind(this.logger)); - const mbr = mem?.struct as GuildMember; + const mbr = mem?.struct; // eslint-disable-next-line @typescript-eslint/no-shadow const embed: APIEmbed = { @@ -262,7 +262,7 @@ class ChannelHandler }, // eslint-disable-next-line no-nested-ternary description: entry.content && entry.content.length ? entry.content.length > 2000 ? `${entry.content.substring(0, 2000)}...\n\n**Content cut off**` : entry.content : '**__MISSING CONTENT__**', - color: mbr.roles.highest.color || 0, + color: mbr?.roles.highest.color || 0, fields: [], timestamp: new Date(entry.timestamp).toISOString() };