/* Made with ❤️ by neoarz I am not responsible for any damage caused by this plugin; use at your own risk Vencord does not endorse/support this plugin (Works with Equicord as well) dm @neoarz if u need help or have any questions https://github.com/neoarz/NitroSniper */ import { IpcMainInvokeEvent } from "electron"; import type { NativeWebhookResponse } from "./types"; export async function sendWebhook(_: IpcMainInvokeEvent, webhookUrl: string, payload: string): Promise { try { const url = new URL(webhookUrl); url.searchParams.set("wait", "true"); const response = await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: payload }); return { status: response.status, data: await response.text() }; } catch (error) { return { status: -1, data: error instanceof Error ? error.message : String(error) }; } }