I can confirm that it works in getting userslist now in Chatzilla by going to Preferences -> irc.twitch.tv -> Lists -> Auto-perform and adding the /raw CAP REQ :twitch.tv/membership and /raw CAP REQ :twitch.tv/commands
Also got it working in Hexchat.
Edit: this is before joining any channels which works for me since I manually do /join #channelname anyways.
on *:NOTICE:The moderators of this room are*:#: {
hload stream stream
.hdel -w stream $chan $+ ;moderators;*
var %modlist = $gettok($1-,2,58)
var %modcount = $numtok($gettok($1-,2,58),44)
var %i = 1
while ( %i <= %modcount ) {
var %modname = $mid($gettok(%modlist,%i,44),2)
.hadd stream $chan $+ ;moderators; $+ %modname %modname
inc %i
}
set %broadcaster $right($chan,-1)
.hadd stream $chan $+ ;moderators; $+ %broadcaster %broadcaster
hsave -o stream stream
}
but now there is the following line in the list (couldnt format as code since $+ was removed then):
$chan
$+ ;moderators; $+ %modname %modname
anyways the broadcaster is now in the list
edit: code updated to fit the new output via NOTICE
Edit: removed if nick ( not needed anymore )
Working on a security thing to prevent setting mods on NOTICE send by a user via irc (hacking)
“In the list” you mean “in hash table”? Its probably caused by your manual input with single “/” from editbox (you need double “//” to evaluate commands).
And why do you hload it? If you request full list isnt it better to hfree old one and hmake again?
well i never used tables befor… basically i load the old file and save the changes (i think) atleast it works as it is atm if u have a better version or corrected version pls feel free to post the code
As i told, you dont need to save\load it, you get full list when type /mods, so its better to delete old table and create new empty. And that means that your $chan-entry was from later just keep being there due to your save\load. (When you add items to hash table - you RE-write old one if they match by value, but other old (moderators, who were un-moded from channel) will still exist in your hash, thats why you need to delete whole table.)
however i would really appreciate if u can post your version of my edited version of the code since i never used Hash tables and i dont know much about them
code updated again since i forgot the if $nick == JTV
this causes a opssible security ishue … if a user knows about IRC and sends a NOTICE to the bot with the same text as twitch does it will get parsed and the user could add his name to the modlist.
Like SeeingBlue I’m also interested in where you got this get-command?
I tried it and it works like a charm, so I’m satisfied but I can’t find it in any documentation regarding tmi.twitch.tv.
I’m just curious because maybe I’m missing out on other features that I could use in my application.