Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lavaclient/lavadeno
lavadeno is a simple, easy-to-use, and flexible lavalink client built on the Deno Runtime.
https://github.com/lavaclient/lavadeno
Last synced: about 1 month ago
JSON representation
lavadeno is a simple, easy-to-use, and flexible lavalink client built on the Deno Runtime.
- Host: GitHub
- URL: https://github.com/lavaclient/lavadeno
- Owner: lavaclient
- License: apache-2.0
- Created: 2020-06-05T10:40:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-05T14:59:06.000Z (almost 2 years ago)
- Last Synced: 2023-08-08T20:48:30.891Z (over 1 year ago)
- Language: TypeScript
- Size: 108 KB
- Stars: 13
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
---
> A powerful lavalink client built on the **Deno** Runtime
> [Discord Server](https://discord.gg/8R4d8RydT4) • [GitHub](https://github.com/lavaclient/lavadeno)- **Flexible:** Lavadeno is a generic library, meaning you can use it with just a connection to the discord gateway, no library restriction.
- **Easy-to-Use**: Lavadeno has a neat and user-friendly promise-based api.
- **Lightweight:** Designed to be small and performant, it's a great choice for any sized project.Setup
Requirements
- Deno Runtime
- [Lavalink v3.x](https://github.com/freyacodes/lavalink)
- Connection to the Discord Gateway.#### Single Node
```ts
import { Node } from "https://deno.land/x/lavadeno/mod.ts";const node = new Node({
connection: {
host: "localhost",
port: 2333,
password: "youshallnotpass",
},
sendGatewayPayload: (id, payload) => sendPayloadToDiscord(),
});node.on("connect", node => console.log(`now connected...`));
node.connect(870267613635309618n);
```
#### Multiple Nodes```ts
import { Cluster } from "https://deno.land/x/lavadeno/mod.ts";const cluster = new Cluster({
nodes: [
{
id: "main",
host: "localhost",
port: 2333,
password: "youshallnotpass",
},
],
sendGatewayPayload: (id, payload) => sendPayloadToDiscord(),
});cluster.on("nodeConnect", node => console.log(`node "${node.id}" is now connected...`));
cluster.init(870267613635309618n);
```### Resuming / Reconnecting
LavaDeno supports exponential backoff and basic reconnection types, along with *manual* reconnecting as reconnecting isn't automatic.
```ts
const node = new Node({
connection: {
// resuming, a key must be supplied or else it wont work.
resuming: {
key: "lavad3n0ftw"
},// exponential backoff
reconnect: {
type: "exponential",
maxDelay: 15000,
initialDelay: 1000,
tries: -1 // unlimited
},// basic
reconnect: {
type: "basic",
delay: 5000.
tries: 5
},
}
})
```---
melike2d © 2018 - 2021