mIRC IRCv3 tags: help!

I am an amateur who runs an mIRC chat bot for a small stream and am trying to update it to use IRCv3 tags in preparation for the deprecation of the TWITCHCLIENT command. I’m having trouble capturing messages sent to the console. When I attempt to capture the raw event (http://en.wikichip.org/wiki/mirc/raw_events), I don’t receive any of the IRCv3 meta tags.

Raw message example:

<- @color=#FF4500;display-name=arcRox;emotes=;subscriber=0;turbo=0;user-type=mod;user_type=mod :arcrox!arcrox@arcrox.tmi.twitch.tv PRIVMSG #nutribot :123test

Using the following remote event:

raw *:*: { echo -t @raw RAW: nick $nick string $1- }

I get the following echo:

RAW: nick tmi.twitch.tv string arcrox!arcrox@arcrox.tmi.twitch.tv PRIVMSG #nutribot :123test

What am I missing to get the all the meta tag information?

edit: to clarify, I have sent the following commands to enable IRCv3 tags:

CAP REQ :twitch.tv/membership
CAP REQ :twitch.tv/commands
CAP REQ :twitch.tv/tags       

I see all the information in my console/status window. I just can’t seem to find a way to capture the and parse the meta tags.

https://github.com/justintv/Twitch-API/blob/master/chat/capabilities.md

You want

CAP REQ :twitch.tv/tags

Yes, I have sent CAP REQ :twitch.tv/tags which is why I even see the meta tags at all in my console/status window. I am just having trouble capturing and parsing them.

you need $rawmsg isntead of $1-

1 Like

Thank you!!!

How did you manage to change your code in your remote to read console messages?

raw *:*: {
  if $nick == tmi.twitch.tv {
    if PRIVMSG isin $rawmsg {
      tokenize 59 $rawmsg
      ;echo -t @raw rawmsg tokens num: $0 1: $1 2: $2 3: $3 4: $4 5: $5 6: $6
      set %displayname $remove($2, display-name=)      
      set %subscriber $remove($4, subscriber=)
      tokenize 32 $6-
      ;echo -t @raw tokens num: $0 1: $1 2: $2 3: $3 4: $4 5: $5
      set %usertype $remove($1, user-type=)
      if (%displayname == $null) { set %displayname $mid($2, 2, $calc($pos($2, !) - 2)) }            
      set %msgtype $3
      set %chan $4
      set %msg $mid($5-, 2, $len($5-))
      ;echo -t @raw %msgtype on %chan (usertype: %usertype sub: %subscriber $+ ) < $+ %displayname $+ > %msg
      echo -t %chan < $+ $iif(%usertype != $null, @, $null) $+ %displayname $+ > %msg
      if (%displayname != bot_name) { parsecommand %msg }
      unset %displayname
      unset %subscriber
      unset %usertype
      unset %msgtype
      unset %chan
      unset %msg
    }
    elseif CLEARCHAT isin $rawmsg {
      tokenize 32 $rawmsg
      var %chan = $3
      var %user = $remove($4, $chr(58))
      if %user != $null {
        ;echo -t @raw user %user timed out on %chan
        echo -t %chan ** %user has been timed out. **
        inc %bancount
        if (%chan == %mainchannelname) { hashstore bancount %user }
        if $inlist(%user, %unbanlist) { msg %chan .unban %user }
      }
    }
    elseif NOTICE isin $rawmsg {
      tokenize 32 $rawmsg
      echo -ts tokens num: $0 1: $1 2: $2 3: $3 4: $4 5-: $5-
      var %chan = $4
      var %notice = $mid($5-, 2, $len($5-))
      echo -t %chan ** %notice **
    }
    else { $null }
  }
}

Please note, that using IRCv3 with mIRC in the above manner bypasses alot of internal functionality of mIRC (such as on text events not firing). There is a feature suggestion to fix this within mIRC that can be found HERE if you’d like to show your support

Thanks SReject!

Thank you arcrox for providing this. Parsecommand unknown command is being displayed though. This gives me good ideas on how to utilize the sub = 1.

Yes, parsecommand is an alias in my script specific to my bot. The general idea is that’s the point in the code that will direct to the sub that will decipher all the commands the bot receives. Posting my code here would be a little overwhelming as there are lots of pieces that depend on others and 5 different pathways for commands to get parsed. I’m also changing things constantly…today for instance, I added whisper capability to my bot.

So yes now i see what this code is doing, it’s echoing in the channel, essentially the old way. However like SReject said, on text events don’t fire.

Since my bot is still working with workarounds i’ve implemented, i’ll wait before making the jump into v3 until i get a better understanding.

Thanks guys!

In the newest mirc which is still in beta, there is a $msgtags identifier which returns color=#1E90FF;display-name=Lilqx;emotes=46354:7-17;subscriber=0;turbo=0;user-type=

To check if someone is a subscriber you can do:

if subscriber=1 isin $msgtags {
…insert code here…
}

to check if the user was a mod you can do

if user-type=mod isin $msgtags {
…insert code here etc…
}

The messages display in channel properly, and all the capability requests work fine.

Please note that it is a closed beta, and not available for download as of yet. There are still features to be added and bugs to be fixed before the beta will be made public

It’s out now.

With the latest version, it does not appear to be reading $msgtags, as i wrote some quick code to see if subscriber=1 or not.

I am running 7.43 which has $msgtags in the release notes. Any ideas?

Are you requesting the twitch.tv/tags capabilities?

Yup, i’ve requested membership, tags, commands via cap req.

just tested it and it’s working fine here.
I used this to test it :stuck_out_tongue:

on :text:!test:#: {
if (subscriber=1 isin $msgtags) {
msg # You’re a sub
}
else { you’re not a sub
}
}

oops, it takes away the star, so add a * in front of :test: :stuck_out_tongue: