We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 874eee9 commit 1855587Copy full SHA for 1855587
app/services/discord/index.ts
@@ -174,14 +174,16 @@ export class DiscordBot extends Service {
174
const guild = this.getGuild();
175
if (!guild) return false;
176
177
+ let banner = "";
178
const bannerURL = guild.bannerURL({ size: 4096 });
179
if (bannerURL) {
180
const bannerBase64 = await getAsBase64(bannerURL);
- this.data.lastDiscordBanner = bannerBase64 ?? this.data.lastDiscordBanner;
181
- await this.data.save();
+ banner = bannerBase64 ?? "";
182
}
183
+ this.data.lastDiscordBanner = banner ?? this.data.lastDiscordBanner;
184
+ await this.data.save();
185
- await guild.setBanner(url, reason);
186
+ await guild.setBanner(url === "" ? null : url, reason);
187
return true;
188
} catch {
189
return false;
0 commit comments