chiro.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

discord.js


Discord server NPM version NPM downloads Patreon

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 { 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");

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, please don't hesitate to join our official Chiro.js Server.

Notice

The documentation is WIP. This is just a temporary docs

Package Sidebar

Install

npm i chiro.js

Weekly Downloads

0

Version

1.0.9

License

MIT

Unpacked Size

65.3 kB

Total Files

18

Last publish

Collaborators

  • snowflake7
  • rohank05