ekmartin / slack-irc

Connects Slack and IRC channels by sending messages back and forth.
MIT License
588 stars 157 forks source link

Random character in slack from irc #144

Open philliproso opened 8 years ago

philliproso commented 8 years ago

The slack-irc bot adds a random character to the slack message, sometimes really strangely.

IRC message example PROBLEM - xxxxxxxxxxxxxxxxxxx IRC message in slack PROBLEM - 5xxxxxxxxxxxxx

Any idea where this comes from or where I should look.

ekmartin commented 8 years ago

If you export NODE_ENV as development you should see a debug log for each Slack message posted (i.e. NODE_ENV=development slack-irc --config). Then you can see the raw message that gets posted to Slack, should help with debugging.

philliproso commented 8 years ago

I narrowed it down to the parseText method in bot.js https://github.com/ekmartin/slack-irc/blob/master/lib/bot.js

ekmartin commented 8 years ago

There's a test for that here: https://github.com/ekmartin/slack-irc/blob/master/test/bot.test.js#L268

You could try adding an assertion using the input message that produces the weird output, then removing replace statements from parseText until it stays the same (for example).

anarchivist commented 7 years ago

I'm wondering if this has something to do with the escape sequences and color codes that are being sent:

screen shot 2016-10-26 at 4 14 21 pm screen shot 2016-10-26 at 4 14 27 pm