// Using npm
npm install poru
// Using yarn
yarn add poru
To use you need a configured Lavalink instance.
- Stable client
- 100% Compatible with Lavalink
- Object-oriented
- 100% Customizable
- Easy to setup
Poru Music Example bot as guide for beginning.
// main file
// Require both libraries
const { Client } = require("discord.js");
const { Poru } = require("poru");
// Initiate both main classes
const client = new Client();
// Define some options for the node
const nodes = [
{
host: "localhost",
password: "youshallnotpass",
port: 2333,
secure:false
}
];
// Assign Manager to the client variable
client.poru = new Poru(client,nodes);
// Emitted whenever a node connects
client.poru.on("nodeConnect", node => {
console.log(`Node "${node.name}" connected.`)
})
// Emitted whenever a node encountered an error
client.poru.on("nodeError", (node, error) => {
console.log(`Node "${node.name}" encountered an error`)
})
// Listen for when the client becomes ready
client.once("ready", () => {
client.poru.init(client);
console.log(`Logged in as ${client.user.tag}`);
});
// Finally login at the END of your code
client.login("your bot token here");
// creating player
const player = await client.poru.createConnection({
guild: message.guild.id,
voiceChannel: message.member.voice.channel.id,
textChannel: message.channel,
selfDeaf: true,
selfMute: false,
})
// Getting tracks
const resolve = await client.poru.resolve('Ignite',"yt");
Feel free to join our discord server, Give us suggestions and advice about errors and new features. with ❤️ by Paras .