Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ChatClient UserInfo.userName is "tmi.twitch.tv" #93

Closed
AlcaDesign opened this issue Feb 11, 2020 · 1 comment
Closed

ChatClient UserInfo.userName is "tmi.twitch.tv" #93

AlcaDesign opened this issue Feb 11, 2020 · 1 comment
Labels

Comments

@AlcaDesign
Copy link
Contributor

AlcaDesign commented Feb 11, 2020

Bug Report

ChatClient's UserInfo isn't working correctly. For example msg.userInfo.userName returns tmi.twitch.tv instead of the actual login.

Code

chatClient.onSub((channel, user, subInfo, msg) => {
    console.log(msg.userInfo.userName); // "tmi.twitch.tv"
});

Example raw IRC:

'@badge-info=;badges=premium/1;color=;display-name=LoginValue;emotes=;flags=;id=12345678-1234-4321-9876-0123456789ab;login=loginvalue;mod=0;msg-id=sub;msg-param-cumulative-months=1;msg-param-months=0;msg-param-should-share-streak=0;msg-param-sub-plan-name=Channel\\sSubscription\\s(somechannelname);msg-param-sub-plan=Prime;room-id=123456789;subscriber=1;system-msg=LoginValue\\ssubscribed\\swith\\sTwitch\\sPrime.;tmi-sent-ts=1580000000000;user-id=987654321;user-type= :tmi.twitch.tv USERNOTICE #somechannelname'

Expected behavior

You should expect "loginvalue" instead of "tmi.twitch.tv".

Actual Behavior

The prefix is not fully populated with the correct value for the user, so you get tmi.twitch.tv instead of something else. (It's just tmi.twitch.tv instead of alca!alca@alca.tmi.twitch.tv or whatever)

/* ... */
_prefix: { nick: 'tmi.twitch.tv' },
/* ... */

Environment

  • Version: twitch-chat-client@3.7.1
  • Node version: 13.8.0
  • Operating system: Windows 10, using Ubuntu 18.04 via WSL
@d-fischer
Copy link
Member

d-fischer commented Feb 11, 2020

Fixed in ff55ef4, to be released some time this week. For a workaround, just use user instead, which should be exactly the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants