mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00

* FINALLY WE REACHED AN AGREEMENT * chore: d-types adapt * websocket sucks, rest * changes * new look for core * 💀 * fix cdn routes, more structures Co-authored-by: Free 公園 <FreeAoi@users.noreply.github.com> * CDN routes * chore: change to rome Co-authored-by: Free 公園 <FreeAoi@users.noreply.github.com> * Oh shit, here we go again Co-authored-by: Free 公園 <FreeAoi@users.noreply.github.com> * fixes * mixin, handler events, ws Co-authored-by: Yuzu <yuzudev@users.noreply.github.com> Co-authored-by: Free 公園 <FreeAoi@users.noreply.github.com> * change type * Error system (#133) * Co-authored-by: Free 公園 <FreeAoi@users.noreply.github.com> * chore: biscuit rebase * token leak goes brrrr * fix: events * chore: road to raw data * fix: managers typing * chore: fix gateway typing * feat: helpers * style: linter * Types for routes (#134) * typing for routes * managers Co-authored-by: Marcos Susaña <marcosjgs03@gmail.com> * Types for routes (#134) * I wanna cry * Next (#136) * Merge #137 * chore: lineWidth to 140 * chore: README update --------- Co-authored-by: Yuzu <yuzuru@programmer.net> Co-authored-by: Free 公園 <FreeAoi@users.noreply.github.com> Co-authored-by: ThisIsAName <46913407+NejireSupremacy@users.noreply.github.com> Co-authored-by: MARCROCK22 <57925328+MARCROCK22@users.noreply.github.com> Co-authored-by: MARCROCK22 <marcos22dev@gmail.com>
49 lines
1.7 KiB
Markdown
49 lines
1.7 KiB
Markdown
# @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
|
|
|
|
[<img src="https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white">](https://github.com/oasisjs/biscuit)
|
|
[<img src="https://img.shields.io/badge/Discord-5865F2?style=for-the-badge&logo=discord&logoColor=white">](https://discord.gg/XNw2RZFzaP)
|
|
|
|
<img align="right" src="https://raw.githubusercontent.com/oasisjs/biscuit/main/assets/icon.svg" alt="biscuit"/>
|
|
|
|
## Install (for [node18](https://nodejs.org/en/download/))
|
|
|
|
```sh-session
|
|
npm install @biscuitland/ws
|
|
yarn add @biscuitland/ws
|
|
```
|
|
|
|
## Example
|
|
|
|
```ts
|
|
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();
|
|
})();
|
|
```
|
|
|
|
## Links
|
|
* [Website](https://biscuitjs.com/)
|
|
* [Documentation](https://docs.biscuitjs.com/)
|
|
* [Discord](https://discord.gg/XNw2RZFzaP)
|
|
* [rest](https://www.npmjs.com/package/@biscuitland/rest) | [core](https://www.npmjs.com/package/@biscuitland/core) | [helpers](https://www.npmjs.com/package/@biscuitland/helpers)
|