Skip to content

Commit ebea560

Browse files
Techbot121Meta Construct
authored andcommitted
fix catching errors I think
1 parent cdf032b commit ebea560

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/services/discord/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ export class DiscordBot extends Service {
7979
async getGuildMember(userId: string): Promise<Discord.GuildMember | undefined> {
8080
if (!this.ready) return;
8181
try {
82-
return this.discord.guilds.cache
82+
const user = this.discord.guilds.cache
8383
.get(this.config.bot.primaryGuildId)
8484
?.members.fetch(userId);
85+
return user;
8586
} catch {
8687
return;
8788
}
@@ -132,7 +133,7 @@ export class DiscordBot extends Service {
132133
const iconURL =
133134
this.discord.user.avatarURL({ size: 4096 }) ?? guild.iconURL({ size: 4096 });
134135
this.data.lastDiscordGuildIcon = iconURL
135-
? (await getAsBase64(iconURL)) ?? this.data.lastDiscordGuildIcon
136+
? ((await getAsBase64(iconURL)) ?? this.data.lastDiscordGuildIcon)
136137
: this.data.lastDiscordGuildIcon;
137138
await this.data.save();
138139
await this.discord.user.setAvatar(path);

0 commit comments

Comments
 (0)