joeyvanlierop / xkcdbot

A reddit bot that automatically links xkcd comics in the /r/xkcd subreddit 🤖
MIT License
37 stars 20 forks source link

Implementation of "Call bot with relevant xkcd: {}" #25

Closed stefanosporiazis closed 4 years ago

stefanosporiazis commented 4 years ago

I added code in function match_token so it also matches numbers that are preceded by "relevant xkcd: ". This is only needed when strict_match is set to True since when it is False, the number will be matched anyway. A few tests are included as well.

I also modified the try/catch block to display a better message when an error occurs, so we can have a better idea of what went wrong.

joeyvanlierop commented 4 years ago

Thank you for your contribution! Closes #13