mattmakai / slack-starterbot

Python-powered simple starter Slack bot.
https://www.fullstackpython.com/blog/build-first-slack-bot-python.html
MIT License
197 stars 146 forks source link

added UTF-8 encoding #5

Open RaphP opened 7 years ago

RaphP commented 7 years ago

I added

-- coding: utf-8 --

Slack recently allowed unicode characters in, and I had a problem with the above code (line 40):

if output and 'text' in output and AT_BOT in output['text']

the : AT_BOT in output['text'] was always false as AT_BOT was a string as output['text'] was unicode.

With that line at the head of the file fixed it for me. I believe it should not pose problem.

Loved your tutorial, really helped me. Best, R.