mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
Fix: sendInteractionResponse
This commit is contained in:
@@ -39,13 +39,63 @@ export async function sendInteractionResponse(
|
|||||||
return await bot.rest.runMethod(bot.rest, "post", bot.constants.endpoints.WEBHOOK(bot.applicationId, token), {
|
return await bot.rest.runMethod(bot.rest, "post", bot.constants.endpoints.WEBHOOK(bot.applicationId, token), {
|
||||||
content: options.data.content,
|
content: options.data.content,
|
||||||
tts: options.data.tts,
|
tts: options.data.tts,
|
||||||
embeds: options.data.embeds,
|
embeds: options.data.embeds?.map((embed) => ({
|
||||||
allowed_mentions: {
|
title: embed.title,
|
||||||
parse: allowedMentions.parse,
|
type: embed.type,
|
||||||
roles: allowedMentions.roles,
|
description: embed.description,
|
||||||
users: allowedMentions.users,
|
url: embed.url,
|
||||||
replied_user: allowedMentions.repliedUser,
|
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: allowedMentions
|
||||||
|
? {
|
||||||
|
parse: allowedMentions?.parse,
|
||||||
|
roles: allowedMentions?.roles,
|
||||||
|
users: allowedMentions?.users,
|
||||||
|
replied_user: allowedMentions?.repliedUser,
|
||||||
|
}
|
||||||
|
: undefined,
|
||||||
file: options.data.file,
|
file: options.data.file,
|
||||||
// TODO: Snakelize components??
|
// TODO: Snakelize components??
|
||||||
components: options.data.components,
|
components: options.data.components,
|
||||||
|
|||||||
Reference in New Issue
Block a user