# My local irc bot isnt assigning operator status to users anymore

**URL:** <https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576>\
**Category:** API\
**Created:** [September 21, 2019, 3:53pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576 "2019-09-21T15:53:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 3:53pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/1 "2019-09-21T15:53:50Z")

</div>

Im calling both CAP REQ on memberships and tags, but it seems assigning OP status has stopped working. As of a day or so ago it seemed to be working as intended, but this morning i noticed that its not anymore.  
Any ideas on where i can begin to start debugging this?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 21, 2019, 4:19pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/2 "2019-09-21T16:19:08Z")

</div>

> [@Ex0dus13](#):
>
> Any ideas on where i can begin to start debugging this?

Don’t bother.

It’s likely the issue is with Twitch itself.

The best way to determine whom is a operator (aka a mod) is to read the tags/badges for a user and test for the presence of the moderator badge instead.

This is more reliable than Operator status. Which has been infrequently bad (but has been stable for a long time until your report just now)

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 6:51pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/3 "2019-09-21T18:51:40Z")

</div>

Unfortunate that its unreliable ☹  
Im looking into searching for the tags to read mod status, but im having a hell of a time figuring out how to exactly call that.  
[http://3.90.232.80/docs/irc/#userstate-twitch-tags](http://3.90.232.80/docs/irc/#userstate-twitch-tags)  
Looks like i can use this to find that data.  
But how exactly do i go about requesting that data in my scripts?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 21, 2019, 6:52pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/4 "2019-09-21T18:52:36Z")

</div>

you already have that data you requests CAP tags

So every PRIVMSG will have tags which’ll contain that users tags and you just see if they have the mod badge

> **[Twitch IRC Tags](https://dev.twitch.tv/docs/irc/tags/#privmsg-twitch-tags)**
>
> Twitch IRC Tags Most IRC messages provide enough information that you can figure out what happened. For example, in the following PRIVMSG message, you know that user abc posted HeyGuys in the xyz channel. :abc!abc@abc.tmi.twitch.tv PRIVMSG #xyz...

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 6:57pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/5 "2019-09-21T18:57:53Z")

</div>

How do you go about retrieving those tags?

```auto
> @badge-info=<badge-info>;badges=<badges>;color=<color>;display-name=<display-name>;emotes=<emotes>;id=<id-of-msg>;mod=<mod>;room-id=<room-id>;subscriber=<subscriber>;tmi-sent-ts=<timestamp>;turbo=<turbo>;user-id=<user-id>;user-type=<user-type> :<user>!<user>@<user>.tmi.twitch.tv PRIVMSG #<channel> :<message>

```

That seems to get the data we want. Now how do i go about actually calling/retrieving that data in my scripts? I assume i’d have to have it run something when people type(?) or join(?) the channel. But what would that code look like.

Really apologize if this is obvious, but coding really isnt my strong suit.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 21, 2019, 6:58pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/6 "2019-09-21T18:58:56Z")

</div>

Depends what language and libraries you are using.

Your library either needs to be IRCv3 compatiable or you are using a Library someone already wrote that supports Twitch nicely

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:01pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/7 "2019-09-21T19:01:22Z")

</div>

Would that be the JSON file that i added awhile back?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 21, 2019, 7:01pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/8 "2019-09-21T19:01:48Z")

</div>

Theres no JSON file attached to this thread?!

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:04pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/9 "2019-09-21T19:04:17Z")

</div>

Sorry, i didnt mean uploaded here. When i got the bot up and running initially, someone pointed me to a JSON.ini that i had to have in my mIRC client.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 21, 2019, 7:04pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/10 "2019-09-21T19:04:47Z")

</div>

Oh you are working in mIRC. No idea about that I’ve never done any programming in mIRC

---

<div class="post-metadata">

**Author:** ![matt\_thomas](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/matt_thomas/32/710_2.png) [@matt\_thomas](https://staging-discuss.dev.twitch.com/u/matt_thomas)\
**Post date:** [September 21, 2019, 7:08pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/11 "2019-09-21T19:08:59Z")

</div>

mIRC, simple echo example with moderator key check.

```
ON *:TEXT:!echotest:#: {
  if ($msgtags(mod).key == 1)) {
    msg # echotest
}
```

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://staging-discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [September 21, 2019, 7:09pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/12 "2019-09-21T19:09:48Z")

</div>

@matt_thomas mod is deprecated you need to check the badges for the mod badge. The mod tag will be removed (at some point)

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:14pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/13 "2019-09-21T19:14:58Z")

</div>

How would we kick off this query, using the same sort of test echo statement?

```auto
> @badge-info=<badge-info>;badges=<badges>;color=<color>;display-name=<display-name>;emotes=<emotes>;id=<id-of-msg>;mod=<mod>;room-id=<room-id>;subscriber=<subscriber>;tmi-sent-ts=<timestamp>;turbo=<turbo>;user-id=<user-id>;user-type=<user-type> :<user>!<user>@<user>.tmi.twitch.tv PRIVMSG #<channel> :<message>

```

I assume we’d have to do like…

If (badge info for mod status) = 1  
do thing  
}

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:16pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/14 "2019-09-21T19:16:48Z")

</div>

if we cant use $msgtags is there a similar function for “$badgetags” or whatever?

---

<div class="post-metadata">

**Author:** ![matt\_thomas](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/matt_thomas/32/710_2.png) [@matt\_thomas](https://staging-discuss.dev.twitch.com/u/matt_thomas)\
**Post date:** [September 21, 2019, 7:18pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/15 "2019-09-21T19:18:41Z")

</div>

$msgtags is the built in mIRC support for handling IRCv3 tags in it’s scripting language. If it’s not available you should certainly update the mIRC client you are using.

EDIT: (include badge check instead)

```
ON *:TEXT:!echotest:#matt_thomas: {
  if ($msgtags(badges).key == broadcaster/1) || ($msgtags(badges).key == moderator/1 )) {
    msg # echotest
  }
}

```

Inlcudes broadcaster badge assuming you want the broadcaster to have the same access.

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:22pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/16 "2019-09-21T19:22:02Z")

</div>

oooo apologizes, i misunderstood what $msgtags do.  
When BarryCarlyon suggested that (mod) was deprecated, how then do we go about searching the badge path, instead of using $msgtags(mod)

I noticed the edit, lemme try that

---

<div class="post-metadata">

**Author:** ![matt\_thomas](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/matt_thomas/32/710_2.png) [@matt\_thomas](https://staging-discuss.dev.twitch.com/u/matt_thomas)\
**Post date:** [September 21, 2019, 7:22pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/17 "2019-09-21T19:22:48Z")

</div>

Edited previous reply to include check for badges.

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:26pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/18 "2019-09-21T19:26:46Z")

</div>

im seeing this when running !echotest

> \* /if: invalid format (line 2, remote.ini)

---

<div class="post-metadata">

**Author:** ![matt\_thomas](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/matt_thomas/32/710_2.png) [@matt\_thomas](https://staging-discuss.dev.twitch.com/u/matt_thomas)\
**Post date:** [September 21, 2019, 7:29pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/19 "2019-09-21T19:29:22Z")

</div>

> [@Ex0dus13](#):
>
> - /if: invalid format

Something may have gone wrong with the copy paste, or if you rewrote it you might be missing a  
(, ), {, or } somewhere.

---

<div class="post-metadata">

**Author:** ![Ex0dus13](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/ex0dus13/32/7071_2.png) [@Ex0dus13](https://staging-discuss.dev.twitch.com/u/Ex0dus13)\
**Post date:** [September 21, 2019, 7:30pm UTC](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576/20 "2019-09-21T19:30:40Z")

</div>

![image](https://d2spem0quai2ol.cloudfront.net/original/2X/9/94a53a0da83aa9ff6f5e90a792b8218d682bf0c6.png)  
This seems proper 🤔  
i even tried to manually retype it because i’ve had issues with copy/paste in the paste.

[Next page](https://staging-discuss.dev.twitch.com/t/my-local-irc-bot-isnt-assigning-operator-status-to-users-anymore/22576.md?page=2)
