swc/crates/swc_bundler/tests/.cache/deno/5ee5b4adddd28fb9d4f15c3d85bb7ba4a08918a6.ts

20 lines
602 B
TypeScript
Raw Normal View History

// Loaded from https://deno.land/x/discordeno@11.0.0-rc.2/src/ws/handle_discord_payload.ts
import type { DiscordGatewayPayload } from "../types/gateway/gateway_payload.ts";
import { ws } from "./ws.ts";
/** Handler for processing all dispatch payloads that should be sent/forwarded to another server/vps/process. */
export async function handleDiscordPayload(data: DiscordGatewayPayload, shardId: number) {
await fetch(ws.url, {
headers: {
authorization: ws.secretKey,
},
method: "post",
body: JSON.stringify({
shardId,
data,
}),
}).catch(console.error);
}