3.0.12 • Published 5 months ago
@biscuitland/ws v3.0.12
@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
Install (for node18)
npm install @biscuitland/ws
yarn add @biscuitland/ws
Example
import { ShardManager } from "@biscuitland/ws";
import { BiscuitREST, Router } from "@biscuitland/rest";
import { GatewayIntentBits } from "@biscuitland/common";
const intents = GatewayIntentBits.Guilds;
const token = "your token goes here";
const rest = new BiscuitREST({ token });
const api = new Router(rest).createProxy();
(async () => {
const connection = await api.gateway.bot.get();
// gateway bot code ↓
const ws = new ShardManager({
token,
intents,
connection,
async handlePayload(shardId, payload) {
console.log("Received payload on shard #%s", shardId, payload);
},
});
await ws.spawnShards();
})();
Links
3.0.12
5 months ago
3.0.11
5 months ago
3.0.9
11 months ago
3.0.10
9 months ago
3.0.8
11 months ago
3.0.7
11 months ago
3.0.6
11 months ago
3.0.5
11 months ago
3.0.4
12 months ago
3.0.2
12 months ago
3.0.1
12 months ago
3.0.0
12 months ago
2.3.0
1 year ago
2.2.3
1 year ago
2.1.2
2 years ago
2.2.0
2 years ago
2.2.2
1 year ago
2.1.1
2 years ago
2.0.3
2 years ago
2.0.2
2 years ago
2.0.5
2 years ago
2.0.4
2 years ago
2.0.6
2 years ago
2.1.0
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago