Skip to content

Commit

Permalink
forgot to set the guildicon as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Techbot121 authored and Meta Construct committed Jan 4, 2025
1 parent 47e4d11 commit 2a5d227
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/services/discord/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ export class DiscordBot extends Service {
this.discord.user?.setActivity(activity);
}

// sets both the bot's avatar and the guild's icon
async setIcon(
path = this.data?.lastDiscordGuildIcon ?? "resources/discord-guild-icons/default.png"
): Promise<boolean> {
if (!this.ready || !this.discord.user) return false;
try {
await this.discord.user.setAvatar(path);
await this.getGuild()?.setIcon(path);
if (this.data) {
this.data.lastDiscordGuildIcon = path;
await this.data.save();
Expand Down

0 comments on commit 2a5d227

Please sign in to comment.