-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement] joke category selection #37
Labels
First issue
Issues suitable for new contributors
Internal
Changes not directly visible to the user: speed improvements, unit tests
Comments
will look into this |
pmayd
added a commit
to pmayd/karmabot
that referenced
this issue
Sep 8, 2020
…gories from pyjokes module and find closest match with difflib
Merged
pogross
added
Internal
Changes not directly visible to the user: speed improvements, unit tests
First issue
Issues suitable for new contributors
labels
Sep 8, 2020
bbelderbos
pushed a commit
that referenced
this issue
Sep 9, 2020
* add error handling for env vars; run pre-commit * improve joke command (issue #37): get list of categories from pyjokes module and find closest match with difflib * refactor logic of category match into helper function with own tests
bbelderbos
added a commit
that referenced
this issue
Sep 9, 2020
* bump version for pypi package generation to match git tag * Fix version (#40) * add runtime file for heroku * allow any 3.7 sub version * breaks heroku deploy, poetry build pack makes this file * dummy commit * version bump * Update README (#42) * Add some Slack and Docker detail to the README Provide some more guidance around finding Slack IDs and tokens, and running the included docker-based postgres server. * Remove readme detail * Allow `topchannels` command in private messages (#41) Let people review the top channel list in the peace and comfort of their own DMs :) * add error handling for env vars; run pre-commit (#43) * fix python version and enable test for PRs * add a fake KARMABOT_DATABASE_URL to the nox env (#48) * Improve joke command (#45) * add error handling for env vars; run pre-commit * improve joke command (issue #37): get list of categories from pyjokes module and find closest match with difflib * refactor logic of category match into helper function with own tests * version bump * Update versions of python, nox, poetry Co-authored-by: AJ Kerrigan <[email protected]> Co-authored-by: Michael Aydinbas <[email protected]> Co-authored-by: Patrick-Oliver Groß <[email protected]>
Merged
Solved. Thanks @pmayd 👍 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
First issue
Issues suitable for new contributors
Internal
Changes not directly visible to the user: speed improvements, unit tests
Joke category selection
karmabot/commands/joke.py
Lines 17 to 21 in ae3871c
Suggestion by @fuzzygwalchmei
use
choice = dict.get(user_text.lower(), "all")
as easier and adaptive approachProblem
User may misspell command and/or add additional words in text
Fix
Check all words and find the most similar command.
Potential approaches:
Further a
dict
of available commands needs to be derived from the PyJokes package.The text was updated successfully, but these errors were encountered: