mIRC Home    About    Download    Register    News    Help

Print Thread
[Twitch] Localized Display Names #259272 25/10/16 10:12 PM
Joined: Jun 2015
Posts: 4
C
Cresentrend Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jun 2015
Posts: 4
I was playing with whispering (using mTwitch) and learned that localized display names (japanese, chinese, korean, etc.) messed with messaging using simply $nick as returning the nick returns the display name, which isn't what I need.

Is there anyway to return the username and not the display name of the person who sent the command?

Re: [Twitch] Localized Display Names [Re: Cresentrend] #259274 25/10/16 10:43 PM
Joined: Apr 2010
Posts: 966
F
FroggieDaFrog Offline
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 966
Thats my script; you can use $msgtags(user-name).key to get the original nick

Last edited by FroggieDaFrog; 25/10/16 10:44 PM.

I am SReject
My Stuff
Re: [Twitch] Localized Display Names [Re: FroggieDaFrog] #259284 28/10/16 03:36 AM
Joined: Jun 2015
Posts: 4
C
Cresentrend Offline OP
Self-satisified door
OP Offline
Self-satisified door
C
Joined: Jun 2015
Posts: 4
When I use that, the bot tries to whisper to itself instead of the person who has used the command that it needs to whisper the reply back to.

Re: [Twitch] Localized Display Names [Re: Cresentrend] #259527 15/12/16 05:28 PM
Joined: Apr 2016
Posts: 86
B
Bestpeff Offline
Babel fish
Offline
Babel fish
B
Joined: Apr 2016
Posts: 86
I would like to reopen this topic because I've ran into the same problem, whenever using $msgtags(user-name).key would always bounce back to me?

Reason I'm using is a cheer script which whenever someone with a localized display name, instead of awarding chat currency to the user (with the localized name) it would always give me it instead. This is the original code I'm working with:

Code:
on $*:text:/(^|\s)cheer\d+(\s|$)/i:#: {
  if ($msgtags(bits).key <= 9) { return }
  if (($msgtags(room-id).key == 62729480) && ($msgtags(bits).key)) {
    msg # !bonus $msgtags(display-name).key $msgtags(bits).key
  }
}

Re: [Twitch] Localized Display Names [Re: Cresentrend] #259657 07/01/17 02:30 AM
Joined: Oct 2015
Posts: 112
B
Blas Offline
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
The reason that $msgtags(user-name).key returns your name, is because that is what the key is for. It returns YOUR name, not the name of the person sending the message.

So I had my first viewer today with a localized display name. I am using SReject's amazing mTwitch scripts as well. My bot returned the users name as being blank as well.

After spending some time trying to understand how mTwitch.DisplayName.mrc worked, I have come up with a fix/work-around that seems to work 100% for now until SReject releases an official fix.

On line 24 on mTwitch.DisplayName.mrc I simply changed:
Code:
    if ($len(%dnick) && %dnick !=== %nick) {

to:
Code:
    if ((%dnick == %nick) && (%dnick !=== %nick)) {


From what I understand, mIRC was trying to change the $nick of the user as long as their display name had a length (existed) and was a non-case sensitive match to their standard twitch user name. I believe the problem was that %dnick was using the foreign language display name which was completely different from the users english user name. I think mIRC didn't know how to handle a display name like "&#32032;&#26228;&#12425;&#12375;&#12356;&#12486;&#12473;&#12488;" so it just returned nothing. I changed the script so that mIRC will only try to change the users name if the display name is a non-case sensitive match to the user name and the display name is not a case sensitive match to the user name. This way, the script doesn't even try to change the user name to a "localized display name" and will just display the lower case english name.

Come to think of it, just "if (%dnick == %nick)" would probably have worked as well. Anyways, I'm sure SReject will come up with a much "cleaner" way of fixing this, but this appears to be working for me for now. smile