aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Make it easier for user to search for tagsGravatar Shirayuki Nekomata2019-10-18-9/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #### Closes #231 Applying the algorithm for `Needles and Haystack` to find and match tag in tags, for example: ![Example](https://cdn.discordapp.com/attachments/634243438459486219/634592981915140107/unknown.png) This only applies to searching tag_name with more than 3 in length, and at least 80% of its letters are found, from left to right. There are 3 levels of checking, stop at first found: - Check if exact name ( case insensitive ) O(1) getting from a dictionary Dict[str, Tag] - Check for all tags that has 100% matching via algorithm - Check for all tags that has >= 80% matching If there are more than one hit, it will be shown as suggestions: ![Suggestions](https://cdn.discordapp.com/attachments/634243438459486219/634595369531211778/unknown.png) In order to avoid api being called multiple times, I've implemented a cache to only refresh itself when the is a gap of more than 5 minutes from the last api call to get all tags. Editing / Adding / Deleting tags will also modify the cache directly. ##### What about other solution like fuzzywuzzy? fuzzywuzzy was considered for using, but from testing, it was giving much lower scores than expected: Code used to test: ```py from fuzzywuzzy import fuzz def _fuzzy_search(search: str, target: str) -> bool: found = 0 index = 0 _search = search.lower().replace(' ', '') _target = target.lower().replace(' ', '') for letter in _search: index = _target.find(letter, index) if index == -1: break found += index > 0 # return found / len(_search) * 100 return ( found / len(_search) * 100, fuzz.ratio(search, target), fuzz.partial_ratio(search, target) ) tests = ( 'this-is-gonna-be-fun', 'this-too-will-be-fun' ) for test in tests: print(test, '->', _fuzzy_search('this too fun', test)) ``` Result from test: ```py this-is-gonna-be-fun -> (30.0, 50, 50) this-too-will-be-fun -> (90.0, 62, 58) ```
* Fix rule alias. (#537)Gravatar scragly2019-10-16-6/+6
|\ | | | | Fix rule alias.
| * Merge branch 'master' into rule-numGravatar scragly2019-10-16-45/+61
| |\ | |/ |/|
* | Merge pull request #511 from python-discord/off-topic-checkGravatar Kieran Siek2019-10-15-45/+61
|\ \ | | | | | | Prevent too similar off-topic channel names
| * \ Merge branch 'master' into off-topic-checkGravatar Kieran Siek2019-10-15-47/+230
| |\ \ | |/ / |/| |
| * | Merge branch 'master' into off-topic-checkGravatar kosayoda2019-10-15-1882/+2058
| |\ \
| * | | Utilize __str__ of discord.Member in logging and outputGravatar kosayoda2019-10-12-47/+33
| | | |
| * | | Add !otn forceadd command.Gravatar kosayoda2019-10-11-0/+8
| | | |
| * | | Add check to !otn add to prevent too similar names.Gravatar kosayoda2019-10-11-2/+24
| | | |
| | | * Fix rule alias.Gravatar kosayoda2019-10-15-6/+6
| |_|/ |/| | | | | | | | | | | | | | Allow rule alias to take rule numbers, passes them to the `site rules` command. Rules are now 1-indexed to conform with the representation on the website.
* | | Create the !mention command. (#493)Gravatar scragly2019-10-15-3/+58
|\ \ \ | | | | | | | | | | | | | | | | Create the !mention command. Co-authored-by: null <[email protected]>
| * \ \ Merge branch 'master' into masterGravatar scragly2019-10-15-1948/+1951
| |\ \ \ | |/ / / |/| | |
* | | | Merge pull request #503 from avayert/masterGravatar Johannes Christ2019-10-14-4/+130
|\ \ \ \ | | | | | | | | | | Add raw command
| * | | | Implement a bypassable cooldown decoratorGravatar Ava2019-10-14-3/+50
| | | | |
| * | | | Small code review fixesGravatar Ava2019-10-11-3/+2
| | | | |
| * | | | Fix linting errorsGravatar Ava2019-10-08-7/+8
| | | | |
| * | | | Fix wrong importGravatar Ava2019-10-08-2/+1
| | | | |
| * | | | Add raw commandGravatar Ava2019-10-08-3/+83
| | | | | | | | | | | | | | | | | | | | Closes #334
* | | | | Merge pull request #378 from larswijn/djangoGravatar Johannes Christ2019-10-14-44/+46
|\ \ \ \ \ | |_|_|_|/ |/| | | | Change pep command to use `.txt` by default
| * | | | Update utils.pyGravatar larswijn2019-10-13-1/+1
| | | | | | | | | | | | | | | Switch around trying order (txt first, then rst)
| * | | | Completely re-submit fileGravatar larswijn2019-07-01-44/+46
| | | | | | | | | | | | | | | to fix the write history of the file
* | | | | Deployment triggerGravatar Joseph Banks2019-10-12-0/+0
| | | | |
* | | | | Merge pull request #495 from kraktus/modif_2Gravatar Mark2019-10-11-1/+40
|\ \ \ \ \ | | | | | | | | | | | | Add Periodic Ping to Checkpoint
| * \ \ \ \ Merge branch 'master' into modif_2Gravatar Leon Sandøy2019-10-12-1/+1
| |\ \ \ \ \ | |/ / / / / |/| | | | |
* | | | | | Merge pull request #518 from python-discord/bump-site-postgres-to-12Gravatar Mark2019-10-11-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Bump the site PostgreSQL version to 12.
| * \ \ \ \ \ Merge branch 'master' into bump-site-postgres-to-12Gravatar Mark2019-10-11-5/+80
| |\ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | Bump the site PostgreSQL version to 12.Gravatar Johannes Christ2019-10-12-1/+1
| | | | | | |
| | * | | | | Merge branch 'master' into modif_2Gravatar Leon Sandøy2019-10-12-5/+80
| | |\ \ \ \ \ | |_|/ / / / / |/| | | | | |
* | | | | | | Merge pull request #421 from python-discord/bot-utils-time-testsGravatar Mark2019-10-11-5/+80
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Add tests for `bot.utils.time`.
| * | | | | | Raise `ValueError` on negative `max_units`.Gravatar Johannes Christ2019-10-12-3/+9
| | | | | | |
| * | | | | | Merge branch 'master' into bot-utils-time-testsGravatar Johannes Christ2019-10-12-353/+352
| |\ \ \ \ \ \ | |/ / / / / / |/| | | | | |
| * | | | | | Add typehints.Gravatar Johannes Christ2019-10-11-3/+2
| | | | | | |
| * | | | | | Merge branch 'master' into bot-utils-time-testsGravatar Johannes Christ2019-10-11-3706/+3119
| |\ \ \ \ \ \
| * | | | | | | Implement test cases suggested by @MarkKoz.Gravatar Johannes Christ2019-10-11-0/+11
| | | | | | | |
| * | | | | | | Add tests for `bot.utils.time`.Gravatar Johannes Christ2019-09-20-4/+58
| | | | | | | |
| | | * | | | | Merge remote-tracking branch 'origin/master' into modif_2Gravatar MarkKoz2019-10-11-1896/+1912
| | | |\ \ \ \ \ | |_|_|/ / / / / |/| | | | | | |
* | | | | | | | Merge pull request #506 from python-discord/token-regex-tweakGravatar Leon Sandøy2019-10-11-5/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Expand token detection regex character exclusion
| * \ \ \ \ \ \ \ Merge branch 'master' into token-regex-tweakGravatar Leon Sandøy2019-10-11-349/+353
| |\ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | |
* | | | | | | | | Merge pull request #509 from python-discord/moderation-tweaksGravatar Leon Sandøy2019-10-11-26/+71
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Moderation tweaks
| * \ \ \ \ \ \ \ \ Merge branch 'master' into moderation-tweaksGravatar Leon Sandøy2019-10-11-3/+2
| |\ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | |
* | | | | | | | | | Merge pull request #512 from python-discord/user-left-logGravatar Johannes Christ2019-10-11-3/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Log member_ban event to #user-log
| * | | | | | | | | | Log member_ban event to #user-logGravatar kosayoda2019-10-11-3/+2
| | |_|_|/ / / / / / | |/| | | | | | | |
| | * | | | | | | | Merge branch 'master' into moderation-tweaksGravatar Leon Sandøy2019-10-11-319/+274
| | |\ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | |
* | | | | | | | | | Merge pull request #488 from K4cePhoenix/Refactor-preparation-methods-of-cogsGravatar Johannes Christ2019-10-11-17/+33
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Prepare cogs on cog init & wait for bot ready flag
| * | | | | | | | | | Merge remote-tracking branch 'origin/master' into ↵Gravatar MarkKoz2019-10-10-1559/+1666
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor-preparation-methods-of-cogs Co-Authored-By: K4cePhoenix <[email protected]>
| * | | | | | | | | | Add missing awaits and call bot as attributGravatar Jens2019-10-07-14/+14
| | | | | | | | | | |
| * | | | | | | | | | Specify names of "prepare_cog" methodsGravatar Jens2019-10-05-19/+19
| | | | | | | | | | |
| * | | | | | | | | | Prepare cogs on cog init & wait for bot ready flagGravatar Jens2019-10-03-18/+36
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #484 from python-discord/extensions-cogGravatar Johannes Christ2019-10-11-302/+241
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | Refactor "Cogs" cog
| * | | | | | | | | | Show help when ext load/unload are invoked without argumentsGravatar MarkKoz2019-10-09-0/+8
| | | | | | | | | | |