Skip to content

Music Library

Seyfert doesn’t have support for playing audio, but we can use an external library called kazagumo.

Installation

First of all, we have to install kazagumo and shoukaku. Both dependencies are extremely necessary when moving 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
import { Client } from "seyfert";
import { Kazagumo } from "kazagumo";
import { type NodeOption, Connectors } from "shoukaku";
const client = new Client();
const nodes: NodeOption[] = [
{
name: "Node",
url: "localhost:2333",
auth: "youshallnotpass",
secure: false
}
];
//Basic configuration, perfect for this case
client.kazagumo = new Kazagumo(
{
defaultSearchEngine: "youtube",
send: (guildId, payload) =>
client.gateway.send(client.gateway.calculateShardId(guildId), payload)
},
new Connectors.Seyfert(client),
nodes
);
//To see whether the node is connected
client.kazagumo.shoukaku.on("ready", (name) =>
console.log(`Lavalink ${name}: Ready!`)
);
declare module "seyfert" {
interface Client {
kazagumo: Kazagumo;
}
}
client.start().then(() => client.uploadCommands());