1.0.6 • Published 3 years ago
cosmic-music v1.0.6
Cosmic Music
Want to make a discord.js music bot? Well, you've come to the right place.
Installation
npm i cosmic-music
Features
- Uses LavaLink
- Easy to use
This package uses shoukaku.
Examples
const { CosmicMusic } = require("cosmic-music");
const Client = new (require("discord.js").Client)();
Client.music = new CosmicMusic([{
name: `node1`,
auth: `youshallnotpass`,
host: `localhost`,
port: 2333,
}], Client);
Client.on("message", async (message) => {
if (message.author.bot || !message.guild) return;
const [cmd, ...args] = message.content.trim().split(/ +/g);
switch (cmd.toLowerCase()) {
case "play":
if (!args.join(" ")) return message.channel.send("Missing query!");
const Result = await client.music.play(message, `youtube`, args.join(" "));
if (!Result) return;
message.channel.send(`Now playing: ${Result.info.title}`);
break;
}
});
You can join the support server here!