riffy-team / riffy Goto Github PK
View Code? Open in Web Editor NEWRiffy is a pro lavalink client. It is designed to be simple and easy to use, with a focus on stability and more features.
License: MIT License
Riffy is a pro lavalink client. It is designed to be simple and easy to use, with a focus on stability and more features.
License: MIT License
Try to use this library with typescript, in the code example below, the arguement passed into the "get" method will be flagged as its defined as a type String instead of string.
this.lavalink = new Riffy(this, lavaNode, {
send: (payload) => {
const guild = this.guilds.cache.get(payload.d.guild_id);
if (guild) guild.shard.send(payload);
},
})
Medium (should be fixed soon)
A commit cause the v3 Lavalink to not playing the tracks(not sending play requests to Lavalink).
That happened while making the updatePlayer method to convert data inputted(taking a single data and convert those) to v3 or v4 depending on the version of Lavalink.
And Yeah Ofc by me while doing this changes.
No response
High (immediate attention needed)
My lavalink is working fine, my code is fine but the bot is not playing audio dont know why..
const { Client, EmbedBuilder, PermissionFlagsBits } = require("discord.js");
module.exports = {
name: "play",
category: "Music",
aliases: ["p"],
clientPermissions: [PermissionFlagsBits.Connect, PermissionFlagsBits.Speak],
description: "Play songs",
inVoice: true,
execute: async (message, args, client) => {
/**
*
* @param {Client} client
* @param {CommandInteraction} interaction
* @param {String} args
* @returns
*/
const query = args.join(' ');
//This will not load the third-party link
if (query.includes(`bit.ly`)) {
return message.channel.send({
embeds: [
new EmbedBuilder()
.setColor(client.embedColor)
.setDescription(`**We Don't Support This Link**`),
],
});
}
let player = client.riffy.players.get(message.guildId);
if (!player)
player = await client.riffy.createConnection({
guildId: message.guild.id,
voiceChannel: message.member.voice.channel.id,
textChannel: message.channel.id,
deaf: true,
});
const resolve = await client.riffy.resolve({
query: query,
requester: message.author,
});
const { loadType, tracks, playlistInfo } = resolve;
if (loadType === "PLAYLIST_LOADED") {
for (const track of resolve.tracks) {
track.info.requester = message.author;
player.queue.add(track);
}
await message.reply(
`Added ${tracks.length} songs from ${playlistInfo.name} playlist.`
);
if (!player.playing && !player.paused) return player.play();
} else if (loadType === "SEARCH_RESULT" || loadType === "TRACK_LOADED") {
const track = tracks.shift();
track.info.requester = message.author;
player.queue.add(track);
await message.reply(`Added **${track.info.title}** to the queue.`);
if (!player.playing && !player.paused) return player.play();
} else {
return message.reply(`There were no results found for your query.`);
}
},
};
"discord.js": "14.11",
"fs": "^0.0.1-security",
"musicard": "^2.0.3",
"riffy": "^1.0.3",
"riffy-spotify": "^1.0.2"
High (immediate attention needed)
Open - If you have any better ideas for this do tell me here or mention and tell me on discord, do tell me if you're interested in resolving it
Explanation: After creating a player with createConnection
along with the region option/parameter set, Creates an Player on the Node matching that "region", If you try searching with resolve
method it will search on other Node and plays on the other Node(previously selected Region Node) That's The main Issue here. It's caused By leastUsedNodes
sorting method in Riffy.
My Solution: To add a node
parameter riffy resolve
method that way the user can parse the player's node while searching.
Another Solution is to modify the leastUsedNodes
But it's not that much reliable compared to 1st solution.
Better Solution I have is to have resolve method in the Player Class itself & Have node
parameter in Riffy resolve
method too.
createConnection
region
parameterregions
defined in the NodeOptions.No response
Medium (should be fixed soon)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.