refactor(embeds): don't create new embed instances when unnecessary (#7227)

This commit is contained in:
Rodry
2022-01-09 16:35:32 +00:00
committed by GitHub
parent f1d4bd68ec
commit 822dc678da

View File

@@ -192,7 +192,9 @@ class MessagePayload {
content, content,
tts, tts,
nonce, 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, components,
username, username,
avatar_url: avatarURL, avatar_url: avatarURL,