mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2013
Posts: 49
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Nov 2013
Posts: 49
And is there a better way to do it? Is there a way to make it return $true/$false maybe? I'd like to use it isntead of checking for the isop because IRC is super slow.

not sure if there's a better option.. maybe someone has some ideas? Feel free! smile

Code:
on *:TEXT:!test:#: {
  $isModerator $chan $nick
  $msgbot($chan, %isModerator. [ $+ [ $chan ] $+ ] . [ $+ [ $nick ] ])
}
alias isModerator {
  var %url = http://tmi.twitch.tv/group/user/lindenkron/chatters 
  var %JSONname = pullModerator
  jsonopen -ud %JSONname %url
  var %moderatorCount = $json(%JSONname, chatters,moderators).length
  
  var %c = 0
  while (%c < %moderatorCount) {
    var %moderatorName = $json(%JSONname,chatters,moderators,%c)
    if (%moderatorName == $2) {
      var %isModerator. [ $+ [ $chan ] $+ ] . [ $+ [ $nick ] ] = true
      }
    inc %c
  }
}


But can't even get it to do the variable properly or display it. Urgh.

Thanks

Joined: Jul 2016
Posts: 28
Z
Ameglian cow
Offline
Ameglian cow
Z
Joined: Jul 2016
Posts: 28
I personally would recommend you use the
Code:
$msgtags(mod).key==1 
instead of
Code:
$nick isop #
This makes use of the message tags which come with the message itself. smile

Joined: Nov 2013
Posts: 49
L
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Nov 2013
Posts: 49
Not sure what $msgtags is.

Does it have instant/faster update speed than isop? Because that doesn't work until IRC Opt's someone, that can take up to a minute.

Edit: Fiddled with it, not sure how to implement it but it seems to work instantly work twitch at least. ty, I'll see if I can make something work with this.

Edit2: Ended up copy pasting a $msgtags snippet someone else was using, I do wonder if anyone can tell me if the $msgtags(mod) doesn't return the channel owner as $true on purpose? And if so, I don't see a parameter to check for channel ownership. The tmi api list also lists you as a moderator on the channel, even if you're a channel owner.

Edit3: Think I worked up a solution, for anyone having similar question:
Code:
alias isAdmin {
  if ($msgtags(badges).key == broadcaster/1) { return $true }
  else { return $false }
}
alias isMod { 
  if ($msgtags(mod).key == 1) { return $true }
  else { return $false }
}
alias isSub {
  if ($msgtags(subscriber).key == 1) { return $true }
  else { return $false }
}


replace
Code:
$nick isop $chan
with
Code:
isMod or isAdmin
or if you want both
Code:
isMod || isAdmin

Last edited by lindenkron; 04/12/16 10:09 PM.

Link Copied to Clipboard