mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 17:30:07 +00:00
edit webhook default original
This commit is contained in:
@@ -9,8 +9,7 @@ import { endpoints } from "../../util/constants.ts";
|
||||
export async function editWebhookMessage(
|
||||
webhookId: bigint,
|
||||
webhookToken: string,
|
||||
messageId: bigint,
|
||||
options: EditWebhookMessage,
|
||||
options: EditWebhookMessage & { messageId?: bigint },
|
||||
) {
|
||||
if (options.content && options.content.length > 2000) {
|
||||
throw Error(Errors.MESSAGE_MAX_LENGTH);
|
||||
@@ -62,7 +61,9 @@ export async function editWebhookMessage(
|
||||
|
||||
const result = await rest.runMethod<Message>(
|
||||
"patch",
|
||||
endpoints.WEBHOOK_MESSAGE(webhookId, webhookToken, messageId),
|
||||
options.messageId
|
||||
? endpoints.WEBHOOK_MESSAGE(webhookId, webhookToken, options.messageId)
|
||||
: endpoints.WEBHOOK_MESSAGE_ORIGINAL(webhookId, webhookToken),
|
||||
{ ...options, allowedMentions: options.allowedMentions },
|
||||
);
|
||||
|
||||
|
||||
@@ -138,6 +138,8 @@ export const endpoints = {
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${webhookId}`,
|
||||
WEBHOOK_MESSAGE: (webhookId: bigint, token: string, messageId: bigint) =>
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${webhookId}/${token}/messages/${messageId}`,
|
||||
WEBHOOK_MESSAGE_ORIGINAL: (webhookId: bigint, token: string) =>
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${webhookId}/${token}/messages/@original`,
|
||||
WEBHOOK_SLACK: (webhookId: bigint, token: string) =>
|
||||
`${baseEndpoints.BASE_URL}/webhooks/${webhookId}/${token}/slack`,
|
||||
WEBHOOK_GITHUB: (webhookId: bigint, token: string) =>
|
||||
|
||||
Reference in New Issue
Block a user