Audio from websites other than a file

I'm new to the discord.js voice section, and I was wondering how to make the bot play music from other websites for example Youtube or Youtube Music, I got it playing music files that are saved on my pc, but currently I'm trying to make it play music from websites, for example I do !play url and it plays the url which is the music video link.
14 Replies
d.js toolkit
d.js toolkit2w ago
- What are your intents? GuildVoiceStates is required to receive voice data! - Show what dependencies you are using -- generateDependencyReport() is exported from @discordjs/voice. - Try looking at common examples: https://github.com/discordjs/voice-examples. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Kourio
KourioOP2w ago
(Installing opus is impossible, since it gives me weird errors, and I'm kind of tired to fix it, it just doesnt work, that's why I use opusscript, which works fine and plays music fine.)
treble/luna
treble/luna2w ago
anything using youtube's api is against TOS and we will not provide support for it
Kourio
KourioOP2w ago
Oh. Sorry, did not know it is against ToS. Well, is there any platform I can stream music from? That is not against ToS? Like spotify or soundcloud or weezer or anything.
treble/luna
treble/luna2w ago
spotify has no playback api you can play music you have rights on
Kourio
KourioOP2w ago
So, how do I do that?
treble/luna
treble/luna2w ago
not related to djs
Kourio
KourioOP2w ago
Sorry as I said I'm still new to discord.js/voice
treble/luna
treble/luna2w ago
you first get the rights
Kourio
KourioOP2w ago
Is there like a doc for spotify's api I can find myself?
treble/luna
treble/luna2w ago
spotify has n o playback api there is basically no source that is TOS compliant
Kourio
KourioOP2w ago
ah So basically all music bots are illegal?
treble/luna
treble/luna2w ago
yes hence why most popular ones shut down
Kourio
KourioOP2w ago
Alright, thanks for letting me know that.

Did you find this page helpful?