2023-06-05 05:01:57 +00:00
..
2023-06-05 05:01:57 +00:00
2023-01-15 05:27:49 -05:00
2023-06-01 19:58:32 -04:00

@biscuitland/ws

Advice

This version of @biscuitland/ws is a fork of @discordeno/gateway, all credits go to them. However it has been heavily modified for proper use within biscuit.

Most importantly, biscuit's ws is:

A standalone gateway to interface Discord, it is meant to be used with a rest manager to send fetch requests to Discord

biscuit

Install (for node18)

npm install @biscuitland/ws
yarn add @biscuitland/ws

Example

import { GatewayManager } from '@biscuitland/ws';
import { BiscuitREST } from '@biscuitland/rest';
import { GatewayIntentBits, Routes} from '@biscuitland/common';

const intents = GatewayIntentBits.Guilds;
const token = 'your token goes here';
const rest = new BiscuitREST({ token });

(async () => {
	const connection = await rest.get(Routes.gatewayBot())

	// gateway bot code ↓
	const ws = new GatewayManager({ token, intents, connection });

	await ws.spawnShards();
})();