Chiro.js is a powerful Node.js module that allows you to easily interact with the Nexus. Chiro.js is highly inspired from Erela.JS which is a module for lavalink.
Node.js 14.0.0 or newer is required.
npm install chiro.js
const { Client } = require("discord.js");
const { Manager } = require("chiro.js");
const client = new Client();
const manager = new Manager({
nodes:
{
host: "localhost",
port: 3000,
password: "mostsecurepassword",
},
send(id, payload) {
const guild = client.guilds.cache.get(id);
if (guild) guild.shard.send(payload);
},
}).on("trackStart", (player, track) => {
console.log(`${track.title} has started`);
});
client.on("ready", () => {
manager.init(client.user.id);
console.log(`Logged in as ${client.user.tag}!`);
});
client.on("message", async (message) => {
if (message.content === "play") {
const player = manager.create({
guild: message.guild.id,
textChannel: message.channel.id,
voiceChannel: message.member.voice.channel.id,
});
const res = await player.send({
query: "play that funky music",
});
player.queue.add(res.tracks[0]);
player.play();
}
});
client.on('raw', (d)=>{
manager.updateVoiceState(d);
})
client.login("token");
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official Chiro.js Server.
The documentation is WIP. This is just a temporary docs