Hello all,I am trying to build a Discord bot that notifies a user whenever a keyword is said in a YouTube livestream chat with Node JS. But first, I need to grab the youtube chat with the Youtube API and OAuth consent. To do this I created a function getLiveChatId() that needs auth for it to work. It returns the live chat ID and so I created another function named getLiveChat() to display the chat with the live chat ID returned in the previous function. getLiveChat()also needs auth to work.But then it gives me an error The API returned an error: Error: Missing required parameters: liveChatId. I think it is because the auth parameter conflicts between both functions? I tried removing the parameter but both functions need authentication in order to work. I also tried creating a separate file for one of the functions and importing it but it also didn't work. Any help?I am still learning Node JS, so my code is based of the Youtube API Node JS quickstart (https://developers.google.com/youtube/v3/quickstart/nodejs). Github is better displaying code than reddit's inline code, so full code here: https://github.com/gallojsantiago/discord-yt-livechat-bot/blob/master/app.jsThank you all for looking. I can't wait to do more stuff with this awesome run time environment!
Submitted January 18, 2020 at 11:05PM by gallojsantiago
No comments:
Post a Comment