mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
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:
@@ -252,9 +252,10 @@ export async function editWebhookMessage(
|
|||||||
const result = await RequestManager.patch(
|
const result = await RequestManager.patch(
|
||||||
endpoints.WEBHOOK_MESSAGE(webhookID, webhookToken, messageID),
|
endpoints.WEBHOOK_MESSAGE(webhookID, webhookToken, messageID),
|
||||||
{ ...options, allowed_mentions: options.allowed_mentions },
|
{ ...options, allowed_mentions: options.allowed_mentions },
|
||||||
);
|
) as MessageCreateOptions;
|
||||||
|
|
||||||
return result;
|
const message = await structures.createMessage(result);
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteWebhookMessage(
|
export async function deleteWebhookMessage(
|
||||||
@@ -552,5 +553,11 @@ export async function editSlashResponse(
|
|||||||
options,
|
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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user