Add WTF Python Command#605
Conversation
ChrisLovering
left a comment
There was a problem hiding this comment.
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. |
…se try to load the extension.
|
|
||
|
|
||
| class WTFPython(commands.Cog): | ||
| """Cog that allows users to retrieve issues from GitHub.""" |
There was a problem hiding this comment.
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.
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.""" |
Kronifer
left a comment
There was a problem hiding this comment.
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.
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! |
Xithrius
left a comment
There was a problem hiding this comment.
@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
Noneif the ratio is below90else 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)?