mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(embeds): don't create new embed instances when unnecessary (#7227)
This commit is contained in:
@@ -192,7 +192,9 @@ class MessagePayload {
|
||||
content,
|
||||
tts,
|
||||
nonce,
|
||||
embeds: this.options.embeds?.map(embed => new MessageEmbed(embed).toJSON()),
|
||||
embeds: this.options.embeds?.map(embed =>
|
||||
(embed instanceof MessageEmbed ? embed : new MessageEmbed(embed)).toJSON(),
|
||||
),
|
||||
components,
|
||||
username,
|
||||
avatar_url: avatarURL,
|
||||
|
||||
Reference in New Issue
Block a user