fix: snakelize request body

This commit is contained in:
ITOH
2021-05-31 19:48:13 +02:00
parent 220ea9ebb8
commit 83b7a708e7
12 changed files with 54 additions and 46 deletions
+2 -5
View File
@@ -5,6 +5,7 @@ import type { Message } from "../../types/messages/message.ts";
import { Errors } from "../../types/discordeno/errors.ts";
import type { ExecuteWebhook } from "../../types/webhooks/execute_webhook.ts";
import { endpoints } from "../../util/constants.ts";
import { snakelize } from "../../util/utils.ts";
/** Send a webhook with webhook Id and webhook token */
export async function sendWebhook(webhookId: bigint, webhookToken: string, options: ExecuteWebhook) {
@@ -47,11 +48,7 @@ export async function sendWebhook(webhookId: bigint, webhookToken: string, optio
`${endpoints.WEBHOOK(webhookId, webhookToken)}?wait=${options.wait ?? false}${
options.threadId ? `&thread_id=${options.threadId}` : ""
}`,
{
...options,
allowed_mentions: options.allowedMentions,
avatar_url: options.avatarUrl,
}
snakelize(options)
);
if (!options.wait) return;