-
-
Notifications
You must be signed in to change notification settings - Fork 255
Add WTF Python Command #605
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
Add WTF Python Command #605
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good, just one issue while testing locally. I think it could be a good idea to have a .wtf list
or similar, to output all of the available pages. Maybe one for after the paginator PR in merged.
Alright will do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…se try to load the extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍🏻
|
||
|
||
class WTFPython(commands.Cog): | ||
"""Cog that allows users to retrieve issues from GitHub.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring seems to be a leftover from copying the cog
"""Cog that allows users to retrieve issues from GitHub.""" | |
"""Cog that allows geting WTF Python entries from the WTF Python repository.""" |
) | ||
|
||
def fuzzy_match_header(self, query: str) -> Optional[str]: | ||
"""Returns the fuzzy match of a query if its ratio is above 90 else returns None.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring mentions a ratio of 90, though the ratio is a global variable and currently 75
"""Returns the fuzzy match of a query if its ratio is above 90 else returns None.""" | |
"""Returns the fuzzy match of a query if its ratio is above `MINIMUM_CERTAINTY` else returns None.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nitpicks, but looks good!
@commands.command(aliases=("wtf",)) | ||
async def wtf_python(self, ctx: commands.Context, *, query: str) -> None: | ||
""" | ||
Search wtf python. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wtf is capitalised in other areas
I don't think I am having enough time to look into this and it has been stale for quite a while now, so whoever wants can take over the PR, and deliver the feature! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@decorator-factory has noticed that this PR still uses fuzzywuzzy
, which contains the GPLv2 license. We now use rapidfuzz
because it uses the MIT license, so this new feature needs to reflect this change.
I think I can take this one, looks like rapidfuzz also has an extractOne method and the change from |
@brad90four I shall assign you. |
Given that the restructure of this bot occurred, the main file of |
Should I get perms to Shivansh's repo in order to push changes to the feature branch or should I make a new PR with a branch from my own repo? |
Make a new PR you will. |
Relevant Issues
Closes #602
Description
Gets the fuzzy match of a search query, returns
None
if the ratio is below90
else returns the fuzzy match. If the return isNone
, then we send our custom Error Message else it sends the link to the subsection of the WTF Python README.md.Reasoning
Approved by a staff.
Screenshots
On Dark Theme
On Light Theme
(I went blind while teking it, and am helf blind rihgt now, so ignre ayn spellign misteke)
Did you:
pipenv run lint
)?