fix(helpers): edit interaction responses & webhook messages does not update files (#2483)

Closes: #2482

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
This commit is contained in:
ITOH
2022-09-30 15:41:09 +02:00
committed by GitHub
parent 357376b954
commit 8fa7e89e8c
4 changed files with 22 additions and 12 deletions

View File

@@ -38,6 +38,7 @@ export async function editFollowupMessage(
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
file: options.file,
},
);

View File

@@ -29,10 +29,13 @@ export async function editOriginalInteractionResponse(
bot.rest,
"PATCH",
bot.constants.routes.INTERACTION_ORIGINAL_ID_TOKEN(bot.applicationId, token),
bot.transformers.reverse.interactionResponse(bot, {
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
{
...bot.transformers.reverse.interactionResponse(bot, {
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
file: options.file,
},
);
return bot.transformers.message(bot, result);

View File

@@ -27,10 +27,13 @@ export async function editOriginalWebhookMessage(
bot.rest,
"PATCH",
bot.constants.routes.WEBHOOK_MESSAGE_ORIGINAL(webhookId, token, options),
bot.transformers.reverse.interactionResponse(bot, {
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
{
...bot.transformers.reverse.interactionResponse(bot, {
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
file: options.file,
},
);
return bot.transformers.message(bot, result);

View File

@@ -30,10 +30,13 @@ export async function editWebhookMessage(
bot.rest,
"PATCH",
bot.constants.routes.WEBHOOK_MESSAGE(webhookId, token, messageId, options),
bot.transformers.reverse.interactionResponse(bot, {
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
{
...bot.transformers.reverse.interactionResponse(bot, {
type: InteractionResponseTypes.UpdateMessage,
data: options,
}).data,
file: options.file,
},
);
return bot.transformers.message(bot, result);