fix: transform embed to discord form

This commit is contained in:
Skillz4Killz
2022-03-25 18:28:25 +00:00
committed by GitHub
parent 707c7c05cb
commit 7bf65ab1c1
3 changed files with 3 additions and 3 deletions
@@ -19,7 +19,7 @@ export async function editInteractionResponse(
: bot.constants.endpoints.INTERACTION_ORIGINAL_ID_TOKEN(bot.applicationId, token), : bot.constants.endpoints.INTERACTION_ORIGINAL_ID_TOKEN(bot.applicationId, token),
{ {
content: options.content, content: options.content,
embeds: options.embeds, embeds: options.embeds?.map((embed) => bot.transformers.reverse.embed(bot, embed)),
file: options.file, file: options.file,
allowed_mentions: options.allowedMentions allowed_mentions: options.allowedMentions
? { ? {
@@ -16,7 +16,7 @@ export async function editFollowupMessage(
bot.constants.endpoints.WEBHOOK_MESSAGE(bot.applicationId, interactionToken, messageId), bot.constants.endpoints.WEBHOOK_MESSAGE(bot.applicationId, interactionToken, messageId),
{ {
content: options.content, content: options.content,
embeds: options.embeds, embeds: options.embeds?.map(embed => bot.transformers.reverse.embed(bot, embed)),
file: options.file, file: options.file,
allowed_mentions: options.allowedMentions allowed_mentions: options.allowedMentions
? { ? {
+1 -1
View File
@@ -22,7 +22,7 @@ export async function editWebhookMessage(
const result = await bot.rest.runMethod<DiscordMessage>(bot.rest, "patch", url, { const result = await bot.rest.runMethod<DiscordMessage>(bot.rest, "patch", url, {
content: options.content, content: options.content,
embeds: options.embeds, embeds: options.embeds?.map((embed) => bot.transformers.reverse.embed(bot, embed)),
file: options.file, file: options.file,
allowed_mentions: options.allowedMentions allowed_mentions: options.allowedMentions
? { ? {