Do you get tired of not having anything to listen to? We this snippet can give you a random song link from youtube so that you have something to listen to!
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const randomUrlGen = require("random-youtube-music-video");
const youtubeUrl = await randomUrlGen.getRandomMusicVideoUrl();
if (context.params.event.content.startsWith(`?randommusic`)) {
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `${youtubeUrl}`,
});
}
console.log(youtubeUrl);
// `https://www.youtube.com/watch?v=XXYlFuWEuKI` (prints youtube video url)