Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Youtube [Data-API] LiveChat where logged-in user is moderator

I'm trying to work out how i get a list of videos/streams where the user is a moderator for live chat.

This is done in nightbot and fussbot but i can't work out how they do it, it works by you adding the Nightbot channel as a moderator of your live streams chat but im unsure how they get your live stream to watch the chat from them being added as a moderator to the channel. (i'm guessing they are a channel moderator and not a video/stream as they are persistent though all casts)

I have thought it would be in the API docs but if it is i can't find it / not sure what im looking for.

I'm implementing this in PHP and so far i have it now getting stream events id's and your persistent live stream ids but i'm now stuck.

like image 617
Barkermn01 Avatar asked Jun 18 '17 19:06

Barkermn01


1 Answers

I don't think the API supports a way to retrieve a list of chats where the logged-in user is a moderator. The liveChatModerators.list method requires that a value be set for the liveChatId parameter, and that value must specify a single live chat ID.

I'll caveat the following by saying that I'm not familiar with the apps you mentioned or how they work, so this is just conjecture. Your question describes a third-party app that lets you (or helps you to) manage YouTube live chats. Presumably, to use the app, you must have granted that app permission to manage your YouTube account.

With that in mind, if you set up a live stream through that app, then the app could, while creating the live stream, also use the liveChatModerators.insert method to add its own channel as a moderator to the live stream's chat. Similarly, the app could retrieve your list of live streams and add its own channel as a moderator to any of those live streams. The app could use its own data store to determine whether its channel had already been added as a moderator for any particular chat.

Please post a comment in reply if you don't think I'm understanding your question.

like image 200
andyland Avatar answered Oct 02 '22 23:10

andyland