mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
fix message embed json serialization (#2420)
* fix message embed json serialization remove the toJSON method on message embeds so the raw data is exposed for JSON seralization. this removes the hexColor property, but it probably should not have been there in the first place. fixes #2419 * change api transform to tojson
This commit is contained in:
@@ -71,9 +71,9 @@ module.exports = async function createMessage(channel, options) {
|
||||
else options.files = options.embed.files;
|
||||
}
|
||||
|
||||
if (options.embed && webhook) options.embeds = [new Embed(options.embed)._apiTransform()];
|
||||
else if (options.embed) options.embed = new Embed(options.embed)._apiTransform();
|
||||
else if (options.embeds) options.embeds = options.embeds.map(e => new Embed(e)._apiTransform());
|
||||
if (options.embed && webhook) options.embeds = [new Embed(options.embed)];
|
||||
else if (options.embed) options.embed = new Embed(options.embed);
|
||||
else if (options.embeds) options.embeds = options.embeds.map(e => new Embed(e));
|
||||
|
||||
let files;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user