# Weird character at the end of every message?

**URL:** <https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964>\
**Category:** Chat and IRC\
**Created:** [March 23, 2021, 1:01pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964 "2021-03-23T13:01:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atlas](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/atlas/32/29870_2.png) [@Atlas](https://discuss.dev.twitch.com/u/Atlas)\
**Post date:** [March 23, 2021, 1:01pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/1 "2021-03-23T13:01:40Z")

</div>

Yo yo yo. I am a software dev, using Node.js and the tmi.js library to create a chatbot.  
The only problem I’m having is that I’m getting “false positives” on my arguments array. At the end of each twitch message, it seems some weird Unicode character is added. And it doesn’t qualify as a string, but it makes any if statement on `args[0]` return truthy.

Any idea as to why this is?

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 23, 2021, 1:04pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/2 "2021-03-23T13:04:28Z")

</div>

Did you try this using a different library/no library at all?

In case it’s a bug with tmi.js as I’m not seeing the issue in my deployed bots, (And I don’t use tmi.js I use no library at all other than WS for connecting)

---

<div class="post-metadata">

**Author:** ![Atlas](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/atlas/32/29870_2.png) [@Atlas](https://discuss.dev.twitch.com/u/Atlas)\
**Post date:** [March 23, 2021, 1:07pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/3 "2021-03-23T13:07:24Z")

</div>

I have not tried any other library.  
When I started making Twitch bots (a while ago). I used tmi.js, so that’s what I am most used to.

But when I started with this particular bot, I wanted to use something more up to date, so I picked dank-twitch-irc, but that was even more buggy.

I glanced over something a week ago when creating a username generator for Twitch (nothing malicious, just random string from the regex Twitch uses/complies with Twitch’s restrictions), a bit of code that removed some part of the message string because they had a similar problem, but as it wasn’t relevant to my project at the time, I don’t remember it.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 23, 2021, 1:08pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/4 "2021-03-23T13:08:50Z")

</div>

Heres my chat “template”

that might help see if you are getting this character

> **[BarryCarlyon/twitch\_misc](https://github.com/BarryCarlyon/twitch_misc/tree/main/chat)**
>
> main/chat

What character are you seeing?

---

<div class="post-metadata">

**Author:** ![Atlas](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/atlas/32/29870_2.png) [@Atlas](https://discuss.dev.twitch.com/u/Atlas)\
**Post date:** [March 23, 2021, 1:10pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/5 "2021-03-23T13:10:02Z")

</div>

It’s two boxes in my command prompt (Windows user, yas), since it’s not UTF8 by default. So when I try to copy and paste it into Google, I get `%F3%A0%80%80%F3%A0%80%80` which is literally the unicode character for undefined.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 23, 2021, 1:10pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/6 "2021-03-23T13:10:59Z")

</div>

Probably time to post your code for others to look at, or raise it on the tmi.js github as an issue (for better visiblity)

---

<div class="post-metadata">

**Author:** ![Atlas](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/atlas/32/29870_2.png) [@Atlas](https://discuss.dev.twitch.com/u/Atlas)\
**Post date:** [March 23, 2021, 1:16pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/7 "2021-03-23T13:16:58Z")

</div>

Oh wow, I was just making the code “forum friendly” and discovered the issue.  
Apparently, there has to be a space when using template literals.  
`"blah${somevar}"` will produce the weird unicode character, but `"blah ${somevar}"` will not.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [March 23, 2021, 1:48pm UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/8 "2021-03-23T13:48:43Z")

</div>

That would do it

but odd it gets unicode-ed out

---

<div class="post-metadata">

**Author:** ![rhymu8354](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/rhymu8354/32/6925_2.png) [@rhymu8354](https://discuss.dev.twitch.com/u/rhymu8354)\
**Post date:** [March 26, 2021, 12:19am UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/9 "2021-03-26T00:19:00Z")

</div>

You should also be aware that many chatters are apparently using clients rigged to get around the “duplicate message” spam restrictions in Twitch. See: [https://github.com/pajbot/tmi-rate-limits](https://github.com/pajbot/tmi-rate-limits) – essentially they append a space character followed by the reserved Unicode character U+E0000 to the end of their message to get around the Twitch filter. As a byte string you’ll see this as `%F3%A0%80%80` which I see you noticed.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [April 25, 2021, 12:19am UTC](https://discuss.dev.twitch.com/t/weird-character-at-the-end-of-every-message/30964/10 "2021-04-25T00:19:02Z")

</div>

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