Access Youtube's liveChatId?

Hello!

I have multiple live streams on my channel. Since there is no way to get the video_id of the current chat that a command is run on (through urlfetch), I was hoping that chatId would contain Youtube’s liveChatId. However, I’ve noticed that chatId contains Nightbot’s internal chat id, not Youtube’s.

Is there any way to get Youtube’s liveChatId for a particular chat?

Hey @eth!

Are you 100% sure it’s giving you Nightbot’s chatID?
Is the following command’s response identical in all of your Live Chats?

!addcom !chatid $(chatid)

If yes, can you take screenshots, I’ll notify the dev because that’d be a bug, that’s not how it’s supposed to work.

Yes, the response is different in all chats. However, it’s not Youtube’s chatId, as i also monitor that one through Youtube’s api directly.

I see.

I’m not sure why you need the liveChatId, Nightbot’s should be enough for commands to have different outputs depending on the chat, that’s what $(chatid) is meant for, but if you really need the liveChatId, as you mentioned, you can use YouTube’s API and $(urlfetch).

I have multiple streams with separate overlays.
I created a !tag command which calls urlfetch with chatId and puts the message into the database.
The message is then pulled through that stream’s overlay. Since I have access to the video_id, I can pull up the youtube chat_id and then extract all the tags from my database which were saved under a specific chatid.

However, since your chatId is internal and not related to Youtube, I was hoping that you could give me the Youtube’s chatId somehow in a variable.

I’m not sure how the dev made that variable, but I’m 99% sure it’s not internal and that he gets the data from YouTube’s API somehow, it’d be counterproductive and a waste of resources to generate one and store it in a database for each chat, you just don’t use the same endpoint.

Regarding your request you’ll have to wait for the dev to have some free time to read it.
But as I said, you can use $(urlfetch) in the meantime.

Can you share which endpoint of the API you’re using? Be careful not to share your tokens.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.