Skip to content

Commit

Permalink
fix: allow unsafe embeds to be serialized (#7494)
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni authored Feb 20, 2022
1 parent b3fa2ec commit 942ea1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/discord.js/src/structures/MessagePayload.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { Buffer } = require('node:buffer');
const { Embed, isJSONEncodable } = require('@discordjs/builders');
const { isJSONEncodable } = require('@discordjs/builders');
const { MessageFlags } = require('discord-api-types/v9');
const { RangeError } = require('../errors');
const DataResolver = require('../util/DataResolver');
Expand Down Expand Up @@ -193,7 +193,7 @@ class MessagePayload {
tts,
nonce,
embeds: this.options.embeds?.map(embed =>
embed instanceof Embed ? embed.toJSON() : this.target.client.options.jsonTransformer(embed),
isJSONEncodable(embed) ? embed.toJSON() : this.target.client.options.jsonTransformer(embed),
),
components,
username,
Expand Down

0 comments on commit 942ea1a

Please sign in to comment.