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

Migrating to user-id's instead of usernames #210

Open
kinsi55 opened this issue Feb 24, 2017 · 4 comments
Open

Migrating to user-id's instead of usernames #210

kinsi55 opened this issue Feb 24, 2017 · 4 comments
Milestone

Comments

@kinsi55
Copy link

kinsi55 commented Feb 24, 2017

As announced months before, Twitch now identifies users by a unique ID instead of their name.

Today, Twitch decided to make a breaking change before v3 API is EOL by allowing full username changes. https://blog.twitch.tv/the-hype-is-real-name-changes-are-here-c629c4697154?sf58352669=1#.7fb8dssk7

So to truly identify users you must now use the unique ID instead of the name, but tmi.js offers no possibility for that.

Apparently, user-id is missing for a lot of IRC messages, but maybe it should be pre-maturely implemented for every event(?)

https://discuss.dev.twitch.tv/t/username-changes-identifying-users/9373/20

@AlcaDesign
Copy link
Member

tmi.js if giving you as much data as it receives. You have to supplement the rest.

@kinsi55
Copy link
Author

kinsi55 commented Feb 24, 2017

Well, e.g. as you can see the subanniversary event has a user-id emitted by IRC

data: '@badges=staff/1,broadcaster/1,turbo/1;color=#008000;display-name=Schmoopiie;emotes=;mod=0;msg-id=resub;msg-param-months=6;room-id=20624989;subscriber=0;system-msg=Schmoopiie\shas\ssubscribed\sfor\s6\smonths!;login=schmoopiie;turbo=1;user-id=20624989;user-type=staff :tmi.twitch.tv USERNOTICE #schmoopiie :Great stream -- keep it up!',

There is no way to get that tough from the resub event
https://docs.tmijs.org/v1.1.2/Events.html#subscription

@AlcaDesign
Copy link
Member

My ideal of this situation is that we change it so that every event emits an object instead. Then you just destruct for what you need:

client.on('subanniversary', ({ channel, message, userstate, months }) => {

});

Then it doesn't matter what our order of arguments are.

@kinsi55
Copy link
Author

kinsi55 commented Feb 24, 2017

Sounds perfect to me. Futureproof and simple to adjust to

@Schmoopiie Schmoopiie added this to the 2.0.0 milestone Apr 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants