mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
refactor: new node features (#5132)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -147,7 +147,7 @@ class MessagePayload {
|
||||
let username;
|
||||
let avatarURL;
|
||||
if (isWebhook) {
|
||||
username = this.options.username || this.target.name;
|
||||
username = this.options.username ?? this.target.name;
|
||||
if (this.options.avatarURL) avatarURL = this.options.avatarURL;
|
||||
}
|
||||
|
||||
@@ -239,7 +239,7 @@ class MessagePayload {
|
||||
name = findName(attachment);
|
||||
} else {
|
||||
attachment = fileLike.attachment;
|
||||
name = fileLike.name || findName(attachment);
|
||||
name = fileLike.name ?? findName(attachment);
|
||||
}
|
||||
|
||||
const resource = await DataResolver.resolveFile(attachment);
|
||||
|
||||
Reference in New Issue
Block a user