Testing if user is in chat

On an average channel I can tell is a user is currently in chat via NAMES on IRC. On a channel with 1000+ viewers NAMES falls back to just listing op’d users.

Is there a way to tell if a particular user is in a busy (1000+ viewers) channel? Or to tell that NAMES has sent me the truncated list? I’m asking because I want my bot only to respond to whispers from people actually in the same chat channel as the bot.

Using https://tmi.twitch.tv/group/user/CHANNELNAME/chatters will returns logged in users in chat. It’s an undocumented endpoint though so might break or change at any time.

Yeah, I’m avoiding TMI for exactly that reason.

Seems a waste of CPU cycles that…

Why would you only want to do that? Generally I get so few whispers it wouldn’t be worth doing such a check.

If you are triggering an unsolicited whispers based on a chat command then you know the chat command originated from your channel.

Otherwise yeah, whispers don’t belong to channels, they are Private Messages (basically).

And it’s always handy if I’ve actually closed a channel for me to whisper the channels bot to check my currency count which would then fail in your scenario.

You could always cache in the bot people whom recently spoke in your target channel rather than using TMI. But whilst we say TMI could break at any time it’s been pretty stable.

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