1.0.9 • Published 3 years ago

chiro.js v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

About

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.

Installation

Node.js 14.0.0 or newer is required.

npm install chiro.js

Example usage

const Discord = require("discord.js");
const Chiro = require("chiro.js");
const client = new Discord.Client();
const manager = new Chiro.Manager({    
    nodes: [{ host: "localhost", port: 3000, password: "SwagLordNitroUser12345", secure: true }],
    onData(id, payload) {
        const guild = client.guilds.cache.get(id);
        if (guild) guild.shard.send(payload);
    },
});

manager.on("ready", () => {
    console.log("Chiro manager is ready.");
});

manager.on("trackStart", (player, track) => {
    console.log(`${track.title} has started playing!`);
});

manager.on("error", console.log);

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 = await manager.createPlayer({
            guild: message.guild.id,
            textChannel: message.channel.id,
            voiceChannel: message.member.voice.channel.id,
        });

        const response = await player.search({ query: "play that funky music" });
        player.queue.add(response.tracks[0]);
        await player.play();
    }
});

client.on('raw', manager.updateVoiceState.bind(manager));

client.login("token");

Links

Help

If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction kindly create an github issue or join our official Chiro.js Support Server.

2.0.0-dev.0

3 years ago

1.0.6-dev.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago