Merge pull request #1394 from TriForMine/patch-12

Fix sendInteractionResponse again
This commit is contained in:
Skillz4Killz
2021-10-30 09:44:49 -04:00
committed by GitHub

View File

@@ -88,14 +88,12 @@ export async function sendInteractionResponse(
: undefined,
fields: embed.fields,
})),
allowed_mentions: allowedMentions
? {
parse: allowedMentions?.parse,
roles: allowedMentions?.roles,
users: allowedMentions?.users,
replied_user: allowedMentions?.repliedUser,
}
: undefined,
allowed_mentions: {
parse: allowedMentions?.parse,
roles: allowedMentions?.roles,
users: allowedMentions?.users,
replied_user: allowedMentions?.repliedUser,
},
file: options.data.file,
// TODO: Snakelize components??
components: options.data.components,
@@ -117,12 +115,60 @@ export async function sendInteractionResponse(
{
content: options.data.content,
tts: options.data.tts,
embeds: options.data.embeds,
embeds: options.data.embeds?.map((embed) => ({
title: embed.title,
type: embed.type,
description: embed.description,
url: embed.url,
timestamp: embed.timestamp,
color: embed.color,
footer: embed.footer
? {
text: embed.footer.text,
icon_url: embed.footer.iconUrl,
proxy_icon_url: embed.footer.proxyIconUrl,
}
: undefined,
image: embed.image
? {
url: embed.image.url,
proxy_url: embed.image.proxyUrl,
height: embed.image.height,
width: embed.image.width,
}
: undefined,
thumbnail: embed.thumbnail
? {
url: embed.thumbnail.url,
proxy_url: embed.thumbnail.proxyUrl,
height: embed.thumbnail.height,
width: embed.thumbnail.width,
}
: undefined,
video: embed.video
? {
url: embed.video.url,
proxy_url: embed.video.proxyUrl,
height: embed.video.height,
width: embed.video.width,
}
: undefined,
provider: embed.provider,
author: embed.author
? {
name: embed.author.name,
url: embed.author.url,
icon_url: embed.author.iconUrl,
proxy_icon_url: embed.author.proxyIconUrl,
}
: undefined,
fields: embed.fields,
})),
allowed_mentions: {
parse: allowedMentions.parse,
roles: allowedMentions.roles,
users: allowedMentions.users,
replied_user: allowedMentions.repliedUser,
parse: allowedMentions?.parse,
roles: allowedMentions?.roles,
users: allowedMentions?.users,
replied_user: allowedMentions?.repliedUser,
},
file: options.data.file,
// TODO: Snakelize components??