Pircbotx usage for new resub changes

Alright, so, I’m at a bit of a loss here.

Anyone that uses the Pircbotx framework, if you’d be so inclined as to share with me how you’re interacting with resub notifications now that they’ve been changed (if you’re even doing so).

It seems the current “official” release is kind of broken in regards to tag support, as they show up in the rawlines but by the time you can actually access the line from the server they’ve been stripped out, which kind of makes it impossible to give thanks for resub notifications.

Does anyone have a current way around this? Am i missing some really obvious way to access the raw line and handle it myself WITHOUT having to build from the source?

I can get the USERNOTICE lines, but that doesn’t really help as all that contains by the time I can see it is the message that is being left, no username and no length of resub.

Pircbotx doesn’t support any Twitch specific commands like USERNOTICE.
Based on the current source code, I guess the only way to interact with USERNOTICEs is the UnknownEvent which doesn’t provide tags without changing the source code

I’ve already submitted a pull request here so the UnknownEvent will have more data, including tags. Hopefully it gets accepted

Mm I saw that. Looking at the track record though, Seems to take quite a bit. At this rate it’d probably be easier to just fork my own copy and add it myself until he catches up though, seeing as “tag support” has been in the works for over a year now

You can check how I do it in my twitch chat library over at https://github.com/Gikkman/Java-Twirk if you want inspiration. You can use that code as inspiration if your want to wrote something yourself, or use the library as is.

Mind you though, I pushed the Usernotice update a few days ago then went on vacation, so I have only unit tested it, not field tested it.

Thanks! Yeah, I went and downloaded the source for Pircbotx not long after I posted this and just tweaked the way it handles events to add tags to everything as well as sending the original raw line within the unknown event as well. I figure that way, going forward, I’ll always be able to do whatever I need to now, just manually.

This is how I am solving this:

@Override
public void onMessage(MessageEvent event) throws Exception {
super.onMessage(event);
if (event.getUser().getNick().equalsIgnoreCase(“twitchnotify”)){
//Perform code here e.g. System.out.println(event.getMessage());
}
}

@osrs_airport This won’t work for resubs only new subs. We removed the twitchnotify message and replaced it with a USERNOTICE.

I already had essentially this implemented, but as DallasNChains mentioned, they’ve altered the way resubs are done. I’ve already reworked it to do it manually through the UnknownEvent.

Using PircBotX? I havent found anything throughout the UnknownEvent, did I miss out on something? What lines do I look out for?

you’d have to fork a copy from the source on github and rework the event yourself, that’s what myself and quite a few others have done

I don’t know if you know, but PircBot and PircBotx are different libraries. I found PircBot to be super easy. That’s what I use. Not that PircBotx is hard or anything, I just started with PircBot and I stuck with it.

I ment I didnt recieve any event when a resub fired in my UknownEvent listener, ill check again and edit this

Edit: You have to request tags :slight_smile:
Edit2: I can read the subscription message if there is one in the Unknown Event, but I can only see the Subscribers name in the Raw Input from sl4j, how do I catch that?

@osrs_airport Like I mentioned above, you need to go to the source page on github for PircBotX and fork your own copy. You’ll then need to alter the event listener and unknown event classes to fit your needs.

I personally tweaked it so that tags are sent to all events, as well as the raw line being sent to the unknown event to deal with any other future changes.

So I have to edit the PircBotX code allright thanks!

Edit: Modified and works :wink:

When I use the onUnknown, it doesn’t capture the resub messages. I was trying to get it to just print the event so I know how to work around it.

Is this normal?

Thanks

Pretty much same answer as above. The default onUnknown of pircbotx only grabs whatever the “line” sent to the server is, which in the event of the new resub notifications is really short and doesn’t really give much info. In order to properly grab them, you’ll have to download the source code of pircbotx and alter the onEvent/onUnknown event functions to send whatever it is that you would prefer.

For example, I personally altered mine to not only have tags sent through, but to also send the full raw line through in the event of any future changes, that way I can handle them on my own.

Yeah, I get it, but my onUnknown doesn’t grab anything, it doesn’t detect resubs at all, but I’ll keep looking into it, thanks.

Have you sent the capabilities for commands/tags?

That was the problem indeed, thanks a lot man, I can now finally rework it a little bit :heart: