justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 380 forks source link

Support getting multiple user objects at once #453

Open ChiriVulpes opened 8 years ago

ChiriVulpes commented 8 years ago

I'm writing a twitch bot and we use the user object to get display names for users (and we also save them into a local database, so that we don't have to constantly request them). However, since you can only get one user at a time, that makes it so there are toooons of requests (which is bad for us, bad for time, and bad for the server)

It'd be great if there was an API for retrieving multiple users at once.

Defman21 commented 8 years ago

https://github.com/justintv/Twitch-API/blob/master/IRC.md#tags and https://github.com/justintv/Twitch-API/blob/master/IRC.md#privmsg There are no reasons to do a request to get display name for a user - it's already in the message :)

ChiriVulpes commented 8 years ago

Hmm. We're using tmi.js. I'm not quite sure if they have support for getting the display name in a message. That could be a little better tho. I'll definitely take a look, thank you!

Defman21 commented 8 years ago

They have. A quick search gave me this: https://github.com/Schmoopiie/tmi.js/blob/master/lib/client.js#L195

ChiriVulpes commented 8 years ago

Yeah, I've already implemented it to use that. Seems like the display name isn't always up to date tho. I guess it'll work like this, but won't be quite as reliable. My previous request still stands. =)