My local irc bot isnt assigning operator status to users anymore

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?

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)

Unfortunate that its unreliable :frowning:
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.
Looks like i can use this to find that data.
But how exactly do i go about requesting that data in my scripts?

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

How do you go about retrieving those tags?

> @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> 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.

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

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

Theres no JSON file attached to this thread?!

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.

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

mIRC, simple echo example with moderator key check.

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

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

1 Like

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

> @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> PRIVMSG #<channel> :<message>

I assume we’d have to do like…

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

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

$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.

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

Edited previous reply to include check for badges.

1 Like

im seeing this when running !echotest

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

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

This seems proper :thinking:
i even tried to manually retype it because i’ve had issues with copy/paste in the paste.