| Commit message (Collapse) | Author | Age | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
#### Closes #231
Applying the algorithm for `Needles and Haystack` to find and match tag in tags, for example:

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:

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.
|
| | |\
| |/
|/| |
|
| |\ \
| | |
| | | |
Prevent too similar off-topic channel names
|
| | |\ \
| |/ /
|/| | |
|
| | |\ \ |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | |_|/
|/| |
| | |
| | |
| | |
| | | |
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.
Co-authored-by: null <[email protected]>
|
| | |\ \ \
| |/ / /
|/| | | |
|
| |\ \ \ \
| | | | |
| | | | | |
Add raw command
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | |
| | | | |
| | | | | |
Closes #334
|
| |\ \ \ \ \
| |_|_|_|/
|/| | | | |
Change pep command to use `.txt` by default
|
| | | | | |
| | | | |
| | | | | |
Switch around trying order (txt first, then rst)
|
| | | | | |
| | | | |
| | | | | |
to fix the write history of the file
|
| | | | | | |
|
| |\ \ \ \ \
| | | | | |
| | | | | | |
Add Periodic Ping to Checkpoint
|
| | |\ \ \ \ \
| |/ / / / /
|/| | | | | |
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Bump the site PostgreSQL version to 12.
|
| | |\ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
|
| | | | | | | | |
|
| | | |\ \ \ \ \
| |_|/ / / / /
|/| | | | | | |
|
| |\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
Add tests for `bot.utils.time`.
|
| | | | | | | | |
|
| | |\ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
|
| | | | | | | | |
|
| | |\ \ \ \ \ \ |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | |\ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
|
| |\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Expand token detection regex character exclusion
|
| | |\ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Moderation tweaks
|
| | |\ \ \ \ \ \ \ \ \
| |/ / / / / / / / /
|/| | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Log member_ban event to #user-log
|
| | | |_|_|/ / / / / /
| |/| | | | | | | | |
|
| | | |\ \ \ \ \ \ \ \
| |_|/ / / / / / / /
|/| | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Prepare cogs on cog init & wait for bot ready flag
|
| | |\| | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Refactor-preparation-methods-of-cogs
Co-Authored-By: K4cePhoenix <[email protected]>
|
| | | | | | | | | | | | |
|
| | | | | | | | | | | | |
|
| | | | | | | | | | | | |
|
| |\ \ \ \ \ \ \ \ \ \ \
| |_|/ / / / / / / / /
|/| | | | | | | | | | |
Refactor "Cogs" cog
|
| | | | | | | | | | | | |
|