When connecting to a channel that is already hosting another channel, the onHost callback returns a value of NaN for the number of viewers rather than undefined.
This is due to a possible change in the notices that Twitch sends. Specifically, when connecting to a channel that is already hosting another channel, Twitch sends a notice in the form of targetchannel -, with a hyphen in the viewer count position.
Bug Report
When connecting to a channel that is already hosting another channel, the
onHost
callback returns a value ofNaN
for the number of viewers rather thanundefined
.This is due to a possible change in the notices that Twitch sends. Specifically, when connecting to a channel that is already hosting another channel, Twitch sends a notice in the form of
targetchannel -
, with a hyphen in the viewer count position.Code
Expected behavior
When connecting to a channel that is already hosting another channel,
onHost
should receive anundefined
value forviewers
.Actual Behavior
When connecting to a channel that is already hosting another channel,
onHost
receivesNaN
forviewers
.Environment
n/a