diff --git a/src/scripts/network/sendMessage.ts b/src/scripts/network/sendMessage.ts index e9db1ec5..bbb587a9 100644 --- a/src/scripts/network/sendMessage.ts +++ b/src/scripts/network/sendMessage.ts @@ -1,8 +1,8 @@ import { APIMessage, WebhookMessageCreateOptions } from 'discord.js'; export default async (message: WebhookMessageCreateOptions, webhookUrl: string) => { - const res = await fetch('https://interchat-networkwebhook.vercel.app/api/send', { - method: 'PUT', + const res = await fetch('https://api.interchat.fun/send', { + method: 'POST', body: JSON.stringify(message), headers: { authorization: `${process.env.NETWORK_API_KEY}`, @@ -13,5 +13,7 @@ export default async (message: WebhookMessageCreateOptions, webhookUrl: string) const resBody = await res.json(); - return res.status === 200 ? (resBody.result as APIMessage) : String(resBody.error); + return res.status === 200 + ? (resBody as APIMessage) + : String(resBody.error.message ?? resBody.error); };