Discord bot youtube search, wait for answer of asynchronous function
问题 I have built a discord but using javascript I've got one command where I want the ability to search for a youtube video and play the first result in a voice channel. I'm using the discordjs and discord-youtube-api libraries. This code looks for the command to search. The args array is the search query else if (command === 'search') { isReady = false; if (message.channel.type !== 'text') return; const { voiceChannel } = message.member; if (!voiceChannel) { return message.reply('please join a