Skip to content

Commit d639759

Browse files
author
Exeteres
committed
fix(discord): Fix webhook creation issue
1 parent 690aae2 commit d639759

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/discord/src/webhookStorage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ export class WebhookStorage {
99
return webhook;
1010
}
1111

12+
const avatarUrl = me.avatarURL();
13+
1214
const webhooks = await channel.fetchWebhooks();
1315
webhook = webhooks.find(x => x.name === me.username);
1416
if (webhook) {
1517
this.webhookMap.set(channel.id, webhook);
1618

17-
const avatarUrl = me.avatarURL();
18-
1919
if (webhook.avatarURL() != avatarUrl) {
2020
await webhook.edit({ avatar: avatarUrl ?? undefined });
2121
}
2222

2323
return webhook;
2424
}
2525

26-
webhook = await channel.createWebhook(me.username, { avatar: me.avatar ?? undefined });
26+
webhook = await channel.createWebhook(me.username, { avatar: avatarUrl ?? undefined });
2727
this.webhookMap.set(channel.id, webhook);
2828
return webhook;
2929
}

0 commit comments

Comments
 (0)