mIRC Homepage

[Twitch] Localized Display Names

Posted By: Cresentrend

[Twitch] Localized Display Names - 25/10/16 10:12 PM

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?
Posted By: FroggieDaFrog

Re: [Twitch] Localized Display Names - 25/10/16 10:43 PM

Thats my script; you can use $msgtags(user-name).key to get the original nick
Posted By: Cresentrend

Re: [Twitch] Localized Display Names - 28/10/16 03:36 AM

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.
Posted By: Bestpeff

Re: [Twitch] Localized Display Names - 15/12/16 05:28 PM

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:

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
Posted By: Blas

Re: [Twitch] Localized Display Names - 07/01/17 02:30 AM

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:
    if ($len(%dnick) && %dnick !=== %nick) {

    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
© 2021 mIRC Discussion Forums