Problems with Twitch IRC Bot

Hey you guys,

I recently started programming a Twitch Chat Bot for myself.
I’m using the mIRC scripting language, but i’m running into an error i can’t figure out.
In my program i’m using

> on *:text:!hi:#:{
>   if ($nick isop #) { msg # Hi there! }
>   else { msg # Sorry, $nick you cannot use this command }
> }

but when i’m running the command i’m always the getting the message in the else block.
I tried it with my bot, who is currently a mod in my channel and with my broadcaster nick.

Every other command is functioning, it’s just that mod/ op thing that’s messed up for me.
Does anyone of you can help me figure out why?


Relying on OP status is a poor way of doing it nowadays. The preferred way is to check the message tags. If you still want to rely on OP status, you need to request the membership capability when connecting to the server.

Thanks for your answer!

Is there any tutorial on how to use CAP REQ ?
Can’t figure out how i bind them in my programm and i can’t find anything useful on google.

You can use the /raw command to send raw data to the server. You can either put this into perform or send them on *:connect. I think you only need one of these though but I suggest using both for most data.

/raw CAP REQ
/raw CAP REQ

Edit: add /tags too. Pretty neat info on users when they send something as second poster already said :).

Basically it’s advisable to send your CAP requests after (the first line of) MOTD and before JOIN

Sending the CAP requests before PASS as the very first thing is how the web chat does it, which also guarantees you get GLOBALUSERSTATE as soon as you login, after MOTD.

You can also bundle the CAP requests in one command CAP REQ (only use the ones you need, of course)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.