fix(handlers/webhook): return Message object instead of raw payload (#611)

* fix: change any to message types

* Update webhook.ts

* Update src/api/handlers/webhook.ts

Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>

Co-authored-by: ayntee <ayyantee@gmail.com>
Co-authored-by: ITOH <72305210+itohatweb@users.noreply.github.com>
This commit is contained in:
Skillz4Killz
2021-03-07 09:39:19 -05:00
committed by GitHub
parent b539d5dd25
commit 9c7340f624
+10 -3
View File
@@ -252,9 +252,10 @@ export async function editWebhookMessage(
const result = await RequestManager.patch(
endpoints.WEBHOOK_MESSAGE(webhookID, webhookToken, messageID),
{ ...options, allowed_mentions: options.allowed_mentions },
);
) as MessageCreateOptions;
return result;
const message = await structures.createMessage(result);
return message;
}
export async function deleteWebhookMessage(
@@ -552,5 +553,11 @@ export async function editSlashResponse(
options,
);
return result;
// If the original message was edited, this will not return a message
if (!options.messageID) return result;
const message = await structures.createMessage(
result as MessageCreateOptions,
);
return message;
}