sreject / mtwitch Goto Github PK
View Code? Open in Web Editor NEWTwitch normalizer for mIRC
Twitch normalizer for mIRC
Trying to figure out why sub and resub messages dont show at all. It shows who subs and how long but doesnt seem to show what they say. I can see it in the user notices in the status window but it wont add it in the channel
I couldnt get it to work myself by editing the mtwitch.core.mrc
So, it looks like whispers today stopped working again.
I saw you call that alias at line 327 but this alias is not present in mtwitch.core!
I'm wondering if you can create an alternative version of mTwitch.DisplayName.mrc that removes localized names for people that want that? Or maybe make it an option somehow?
The problem I have is that if I use the mIRC script, it will only show the localized name, since that is the display name.
On Twitch it normally shows both the localized name and the username, and a lot of people (including myself) also use BTTV to completely remove the localized name.
The problem with having only the localized name, for me at least, is that it makes it really difficult to moderate a channel with lots of Korean chatters, because I can't type out their name, or tab-complete it.
Here's an example: 비서91 (bsuh91)
Here's his Twitch API
Here's his parseline:
@badges=premium/1;color=#1E90FF;display-name=비서91;emotes=;id=83baf952-c9b7-4323-844a-91d62a6cec95;mod=0;room-id=36625500;sent-ts=1496084548967;subscriber=0;tmi-sent-ts=1496084549486;turbo=0;user-id=90456573;user-type= :[email protected] PRIVMSG #rebebbiz :test
BetterTTV can just replace the name with what's inside the brackets, so that's easy for them. But for IRC we probably need to test the display name for non-alphanumeric characters.
That above parseline would normally look like this: <비서91> test
But I think I fixed it now to this: <bsuh91> test
I changed the code to this, and it works fine for me:
if ($mTwitch.isServer) {
%dnick = $remove($mTwitch.MsgTags(%tags, display-name), $chr(32), $cr, $lf)
if ($regex(%dnick,/\W/)) {
.parseline -it %tags $+(:, %nick, %param)
}
elseif (%dnick !== $null && %dnick !=== %nick) {
.parseline -it %tags $+(:, %dnick, %param)
}
}
I figured if %dnick
is empty it will return 0 anyway, so there's no need for other checks than the regex for localized check.
I removed that user-name=
insertion just to make it easier to read. But maybe you'd also want to add a localized-name=
thing or something?
I'm sure more people would be happy with a change like this, so I thought I'd share :)
I need feedback on how this should be implemented, use cases, etc.
I recently looked over your parseline on how you get the whispers that are directed to the bot. Though I am quite curious if you have any ideas or examples as to how the bot would respond to that whisper.
The goal I am working towards is that if someone whispers a command !birthday for instance. To the bot that it would react the same as if the user whispered it in the channel.
Thank you sincerely for your time and your effort on this.
On line 7 of mTwitch.DisplayName.mrc, due to new Twitch requirements, a "client id" is now required for the script to read from the Twitch API. https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.ek6t4qpra
Having the | character in the title of a stream (and I'd assume game as well) makes mirc parse the rest of the title as a new line, allowing for someone to possibly execute code. I tested for fun on another network not utilizing your script, and as expected it was not parsed as a new line.
I don't know if there's an easy way to fix this, as I'm way below this level of scripting, but replacing that in the original %title grabber with $chr(166) proved to work quite well for me.
actual title
mirc title via StateToTopic
attempted "code" execution
Hi. I just restarted my mIRC bot and got this message:
[mTwitch->GroupChat] Connection to Twitch Group-Chat server lost; attempting to reconnect...
I noticed the script has been updated 9 days ago and updated it, but I still get the message above.
Yes, v3 will continue to work until 2018 but they still recommend people to migrate whenever possible.
Specifically these changes I've noticed so far affect mTwitch.
- The new version of the API uses user IDs instead of user names to reference users.
- Sub-second precision was added to time fields
alias mTwitch.ConvertTime
This is going to have to accept the new timestamps.
mTwitch.DisplayName.mrc
This request is no longer going to work because it will expect a user ID:
https://api.twitch.tv/kraken/users/ $+ $mTwitch.UrlEncode($me)
API documentation: Translating from User Names to User IDs
Actually, it also returns display_name (as shown in the example) so we're not gonna need to make another request 👍 Live sample data
So I guess it would look something like this:
JSONOpen -uw mTwitch_NameFix https://api.twitch.tv/kraken/users?login= $+ $mTwitch.UrlEncode($me)
JSONHttpHeader mTwitch_NameFix Client-ID gjiaolylvp6t7gukddfzee9ehets66w
JSONHttpHeader mTwitch_NameFix Accept application/vnd.twitchtv.v5
I would submit a pull request if I knew how to handle the output.
(I'm sure mTwitch.StateToTopic.mrc is going to need a lot of work, but I'm not using that myself)
Thanks for the excellent work with this script!
Instead of having multiple scripts, should I just go ahead and merge core+all modules into a single script?
Using the very latest mTwitch.Core.mrc (0000.0000.0011) and mTwitch.DisplayName.mrc (0000.0000.0003). Twitch display names no longer work at all for me. My bot replies with all lowercase usernames now.
I get this http://prntscr.com/ayan2l
I updated jsonformirc, mtwitch.core and mtwitch.statetotopic but the channels are always offline. Am i missing something on the new version of mtwitch?
People that don't have a display name set will be named $true when using mTwitch.DisplayName.mrc
PARSELINE:
@badges=premium/1;color=#008000;display-name=;emotes=25:72-76;id=dd165c3b-64c6-4d7d-97bf-0d6f88bdf28b;mod=0;room-id=36625500;sent-ts=1487525560768;subscriber=0;tmi-sent-ts=1487525560386;turbo=0;user-id=32161641;user-type= :[email protected] PRIVMSG #rebebbiz :theres a secret ending btw
Chat:
<$true> theres a secret ending btw
Using mTwitch.Core.mrc and mTwitch.DisplayName.mrc. Users with a Twitch "localized display name" are not being recognized. mIRC simply returns their name as nothing.
Not sure if this is entirely the code's fault, but since twitch has moved their chat servers a bit, whispers are no longer sending.
kraken -> helix
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.