Nightbot on Discord sending invalid username?

I run a service that some streamers use, we have support for NightBot and it works just fine when used with Twitch. It also works fine for most users on Discord, but when the username on Discord is in a different language like Japanese, NightBot doesn’t send us the UTF-8 but instead something like “\xad\xc4\xcd”.

I haven’t been able to have that get converted because it doesn’t seem to send us exactly what we need to convert it back to UTF-8.

Does anyone have any suggestions on what to do or could this be a bug with Nightbot when sending $(user) and UTF-8 only names?

Also the endpoint that the bot is hitting is in PHP.


If you require user/channel information, you can check for the Nightbot-Channel and Nightbot-User headers we send with the GET request to your server. Each of those headers contain a url-encoded form.

For any data you pass as a querystring to the bot, you would also need to encode it. You can use the $(querystring) variable to do that. Passing no arguments to the querystring variable makes it return the entire query url-encoded, while passing it an argument causes it to encode the passed argument.

1 Like

Great. No issues with passing data as a querystring. But the headers works. Thank you for your help!

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