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
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.
@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());
}
}
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.
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
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.
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.