aitorres / dogpicsbot

A simple Telegram bot that sends random dog pictures.
MIT License
9 stars 4 forks source link

fix: tokenizes words when searching for specific triggers #4

Closed german1608 closed 4 years ago

german1608 commented 4 years ago

At this moment, the bot sends dog pics for specific emotions (sadness, for example) whenever it finds any of the configured words on the message, even when any of those words where found inside of another word on the text.

For example, the word download includes the sad word down, but the message My download of "The Legend of Zelda: Breath of the Wild" has started was detected as a sad message, even when it's not sad at all!

This PR fixes that by tokenizing the lowercased text and comparing directly against the words on that set. It also improves the #Installation section of the README a little bit to include commands for anaconda users

aitorres commented 4 years ago

@german1608 thank you your contribution!