justintv / Twitch-API

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

Twitch IRC doesn't send Display-Name for certain users #630

Open Splinti opened 7 years ago

Splinti commented 7 years ago

Ive recently found a bug on one of my friends channel. His moderator couldn't execute any commands of the bot that I programmed and that was because of the Twitch Chat not sending the display-name TAG. Today another user of my Channel bot experienced the same problem and this is what the IRC sent to my program:

@badges=moderator/1; color=; display-name=; emotes=; id=xxxxxxxxx; mod=1; room-id=xxxxxxxxx; sent-ts=xxxxxxxxx; subscriber=0; tmi-sent-ts=xxxxxxxxx; turbo=0; user-id=xxxxxxxxx; user-type=mod :splinti98!splinti98@splinti98.tmi.twitch.tv PRIVMSG #channel : As you can see, the server didn't send a display-name. The not-executing command-part is on my side, but I think the part with the display-name not sending is on the IRC's side.

freaktechnik commented 7 years ago

The server sent an empty display name, which means the user has not set any capitalization preference. Values in the Twitch API are generally empty or null unless the user has set them.

Splinti commented 7 years ago

Oh so I need to get the users capitalized name somewhere else, I guess. Thanks for your fast answer

freaktechnik commented 7 years ago

It means that it's just the username that twitch sends in the IRC message (splinti98!splinti98@splinti98.tmi.twitch.tv contains it like three times). If you want to do it Twitch chat style, you'd capitalize the first letter, exactly.

BarryCarlyon commented 7 years ago

Oh so I need to get the users capitalized name somewhere else, I guess.

There is no capitalised name to get, ie, there is no somewhere else. The users display name in this case is "Uppercasefirstletter" or username/login

(Just for clarity)