PyBites-Open-Source / karmabot

A Python based Slack Chatbot for community interaction
MIT License
73 stars 47 forks source link

Uncaught exception on giving self karma #10

Closed mogtek closed 6 years ago

mogtek commented 6 years ago

Using the current master code, the bot crashes when a user tries to give karma to themself.

Looks like a bug that was introduced when karma.py was refactored to use a class - the ValueError that's raised in the constructor is never caught. (As a quick bandaid, I just moved the function calls in process_karma_changes into the try-except block, works okay so far)

Small bug and the bot is otherwise very useful - thanks for your work!

bbelderbos commented 6 years ago

Excited to hear you are using it - where? (if you can share) Yeah I reproduced it, will fix it now. Thanks

bbelderbos commented 6 years ago

Fixed :)

screen shot 2018-08-27 at 21 57 00
mogtek commented 6 years ago

Thanks for the rapid fix! I don't see the change reflected on master though, was it merged?

Answering your question, it's being used at a large-ish company in the medical field. One department (~50 users) previously used HipChat, but has recently migrated to Slack due to Hipchat's impending discontinuation. I probably shouldn't give the company name, since I'm not an employee, I've just been helping out a friend there who's handling the migration.

Anyway, some of the users really enjoyed the HipChat karma bot and asked for a Slack equivalent. Your bot using the same syntax as the Hipchat version was a big advantage, minimizes disruption. My friend's also eager to learn more about Python - IIRC he found the bot via your PyBites article - so having a bot he can run locally and tweak is great :)

bbelderbos commented 6 years ago

Sorry pushed to pi0 where the bot runs (we use it on our PyBites Slack), not to Github, done now.

Thanks for the background info, really cool.

If your friend has ideas for more features he can contact me or log an issue here.