on *:text:*:#: {
if ($strip($1) == !viewerupdate) {
if ($strip($2) == $null) {
set %viewerschan $chan
msg $chan Viewer Update Has Been Started
.timer.update 0 60 sayviewers $chan intellibot_v2.0 nightbot wizebot
}
if ($strip($2) == off) {
msg $chan Viewer Update has been stopped
.timer.update off
}
}
}
alias sayviewers {
set %viewers $nick($1,0)
var %v = 1
while (%v <= $nick($1,0)) {
if ($istok($2-,$nick($1,%v),32)) {
dec %viewers 1
}
inc %v
}
JSONOpen -ud followcount https://api.twitch.tv/kraken/channels/ $+ $mid(#, 2-)
msg $1 Stream update for $remove(#,$chr(35)) followers: $json(followcount, followers) Viewers: %viewers
}
on *:part:#: {
if ($chan == %viewerschan) {
if ($timer(.update)) {
.timer.update off
}
}
}