My local irc bot isnt assigning operator status to users anymore


#1

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?


#2

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)


#3

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


#4

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


#5

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


#6

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


#7

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


#8

Theres no JSON file attached to this thread?!


#9

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.


#10

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


#11

mIRC, simple echo example with moderator key check.

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

#12

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


#13

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>.tmi.twitch.tv PRIVMSG #<channel> :<message>

I assume we’d have to do like…

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


#14

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


#15

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


#16

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


#17

Edited previous reply to include check for badges.


#18

im seeing this when running !echotest

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


#19

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


#20

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