Different username in message from notice event handler than expected

Hello, and thanks for reading this post!

I ran into a problem when I tested my tool on banning an amount of bot accounts.

The tool uses an event handler to listen for new ban events. Then the username that was just banned is written to a file. During the tests, I found one specific username that did not behave as expected: bryan1231.

Because when I use the command /ban bryan1231, the ensuing message I will receive is ブライアン442 is already banned in this channel. (Don’t pay attention to the already banned notice. Yes, I’ve tested this before and I’m not unbanning in-between tests.)

To me, it looks like a mismatch in string encoding, although I can’t figure out in what encoding messages are sent. To my knowledge, I’m decoding UTF-8. And, it should be mentioned, this is the only bug of this kind I’ve encountered among hundreds of usernames. And it occurs consistently. I’ve not been able to receive “bryan1231” in a notice.

I checked https://api.twitch.tv/helix/users?login=bryan1231

And the “notice” is reporting their display name rather than username/login

I’m unclear what the problem is you are reporting other than the notice using the display name (a few chat events do that see:

)

You might be interested in

or

to track ban/is ban/not ban
or the related eventsub topics.

But I’m not unclear what the problem is or what you want to get solved?

You cleared up my confusion! I didn’t realize ブライアン442 was a display name. I should stop relying on the notice system then, because I really need the userlogin.

And thank you for the tips on getting a list of all banned users through the API. But the low speed at which the API sends this data is actually why I want to keep an offline list of banned users in the first place.

S’all good!

A number of users will have set a “localised” displayname but for more use the display name is jUSt the CaPitiLASTION control.

But you’ll find some korean/japanese/etc names and in some cases some with a space in (Such as Riot Games for example)

Sounds like you need eventsub which is real time

I’ll look into that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.