mirror of
https://github.com/discordjs/discord.js.git
synced 2026-06-04 10:00:08 +00:00
perf: use logical assignments instead of if statements (#6693)
This commit is contained in:
@@ -245,7 +245,7 @@ class Webhook {
|
||||
if (avatar && !(typeof avatar === 'string' && avatar.startsWith('data:'))) {
|
||||
avatar = await DataResolver.resolveImage(avatar);
|
||||
}
|
||||
if (channel) channel = channel?.id ?? channel;
|
||||
channel &&= channel.id ?? channel;
|
||||
const data = await this.client.api.webhooks(this.id, channel ? undefined : this.token).patch({
|
||||
data: { name, avatar, channel_id: channel },
|
||||
reason,
|
||||
|
||||
Reference in New Issue
Block a user