Distube and sapphire

I am trying to use the npm of distube since the lavalink was not working for me and before distube does work, the problem is that the file where the distube client is defined I pass it to load it to the index and I make a console.log(client.distube) and if it detects it but when using it in a command it comes out as undefined and I already tried to do everything and nothing, If anyone can help me with this, I appreciate it, whether it's Lavalink or Distube, to help me
Solution:
@Skyra used to have lavalink with sapphire long long ago but you can go back in the commit history to find it eventually. That said assuming you're gonna be playing from YouTube keep in mind that doing so is against the YouTube and by extension Discord's terms of service and can lead to your bot being terminated. Having music functionality will certainly give you a very low chance to get your bot verified. Also in regards to YouTube, people can already use voice channel activities to listen together....
Jump to solution
6 Replies
Gomita
GomitaOP12mo ago
Index
No description
Gomita
GomitaOP12mo ago
Command:
// play.js
const { Command } = require("@sapphire/framework");
const { sendArgsError } = require("../../utils");

class PlayCommand extends Command {
constructor(context, options) {
super(context, {
...options,
description: "Musica",
aliases: ["p"],
});
}

async messageRun(message, args) {
try {
const client = this.client;
console.log(client.distube)
} catch (error) {
console.error(error);
}
}
}

module.exports = PlayCommand;
// play.js
const { Command } = require("@sapphire/framework");
const { sendArgsError } = require("../../utils");

class PlayCommand extends Command {
constructor(context, options) {
super(context, {
...options,
description: "Musica",
aliases: ["p"],
});
}

async messageRun(message, args) {
try {
const client = this.client;
console.log(client.distube)
} catch (error) {
console.error(error);
}
}
}

module.exports = PlayCommand;
Gomita
GomitaOP12mo ago
Gist
Distube
GitHub Gist: instantly share code, notes, and snippets.
Solution
Favna
Favna12mo ago
@Skyra used to have lavalink with sapphire long long ago but you can go back in the commit history to find it eventually. That said assuming you're gonna be playing from YouTube keep in mind that doing so is against the YouTube and by extension Discord's terms of service and can lead to your bot being terminated. Having music functionality will certainly give you a very low chance to get your bot verified. Also in regards to YouTube, people can already use voice channel activities to listen together.
Favna
Favna12mo ago
Also I'm not sure what lavalink has been up to over the past years but back when skyra transitioned the main project had already basically died and it was being held together by ductape by other contributors After the banning of the old Rhythm and Groovy bots people massively stopped using music bots. A big factor is that bot music streaming quality is really graunchy compared to just playing it back yourself.
Gomita
GomitaOP12mo ago
About the terms I understand and I know that, but thanks for the clarification and I'm going to try to find how to do it I'm going to try to find the commit from where they removed the lavalink to give me an idea of how to do it
Want results from more Discord servers?
Add your server