Equivalent to HOSTTARGET for getting hosted

Hello,
is there an equivalent irc messasge that gets sent to the target channel containing the relevant data (hosting channel and number of viewers) in the irc tags? Currently there are only 2 way of programatically know when being hosted:

  • checking for the jtv text notification “X is now hosting you for up to Y viewers.” and parse that. Parsing notification messages is rather unsafe though, and, unlike HOSTTARGET, there is no message at the end of the host, so there’s no differentiating between getting hosted for 1 second or 10 hours.
  • checking the tmi api. Unfortunately that’d require constant polling to know when being hosted, and due to caching the api has unacceptable delay. Not like it’s an official api anyway
1 Like

Not to my knowledge. You’d have to capture the message and parse it. All of the relevant docs will be around here on GitHub. You’re correct about the TMI API not being officially supported, so I wouldn’t rely on it. There is a lot of polling when building an application using the Twitch API, so I wouldn’t be too shy about the practice. :slight_smile:

You should keep in mind that the first method (the parsing) only works if youre logged in as the broadcaster, since the message is only sent to the broadcaster and not everyone in chat. If that would be changed it would be the easier way tho.

2 Likes

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