$(chatid) change?

We’ve been using the semi-documented chatid variable to determine which live chat on our youtube channel is the the one Nightbot’s been called from. We use this to index into a JSON database to which city to use for $(weather).

So doing !weather in the New York chat automatically gives New York weather.

Apparently today, the value returned by $(chatid) changed. It’s still unique and could be used to index weather but it’s a shortened form of the full Google chatid which can also be used for certain Youtube API calls (and we do use this database to simplify API access).

Is this change intentional and is it permanent?

The chat id is actually not something we control. It’s what YouTube’s APIs tell us the id is. I believe YouTube’s on their third iteration of chat internals (from what I heard through the grapevine), so it is possible they changed their identifiers when they moved to this iteration. You may want to store data for a channel id rather than a chat id.

1 Like

Thanks, that prompted me to look a little further.

While google’s video:list API is still returning the “long form” chatId, the other APIs do accept the short form that nightbot is now returning.

This solves my problem.

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