Skip to content

Music Library

In Seyfert, we can play music using an external library called kazagumo.

Installation

First of all, we have to install kazagumo and shoukaku. Both dependencies are extremely necessary to move forward within this guide.

Dependencies...
pnpm add kazagumo shoukaku

Setup

For further information about the different options and events of kazagumo see the official bot example

index.ts
1
import { Client } from "seyfert";
2
import { Kazagumo } from "kazagumo";
3
import { type NodeOption, Connectors } from "shoukaku";
4
5
const client = new Client();
6
const nodes: NodeOption[] = [
7
{
8
name: "Node",
9
url: "localhost:2333",
10
auth: "youshallnotpass",
11
secure: false
12
}
13
];
14
15
//Basic configuration, perfect for this case
16
client.kazagumo = new Kazagumo(
17
{
18
defaultSearchEngine: "youtube",
19
send: (guildId, payload) =>
20
client.gateway.send(client.gateway.calculeShardId(guildId), payload)
21
},
22
new Connectors.Seyfert(client),
23
nodes
24
);
25
26
//To see if the node is connected
27
client.kazagumo.shoukaku.on("ready", (name) =>
28
console.log(`Lavalink ${name}: Ready!`)
29
);
30
31
declare module "seyfert" {
32
interface Client {
33
kazagumo: Kazagumo;
34
}
35
}
36
37
client.start().then(() => client.uploadCommands());