aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-02-15Bot: move connector/session recreation to a separate functionGravatar MarkKoz-2/+5
The function itself doesn't need to be a coroutine. It just has to be called in a coroutine (or, more indirectly, in an async context?).
2020-02-15Bot: override login() instead of start()Gravatar MarkKoz-4/+5
The client can be used without running a bot so it makes more sense for the connector to be created when logging in, which is done in both cases, rather than in start(), which is only used when running a bot.
2020-02-14Bot: fix error trying to close a None sessionGravatar MarkKoz-1/+3
2020-02-13Bot: add warning for when connector is a specified kwargGravatar MarkKoz-0/+6
2020-02-13Bot: avoid DeprecationWarning for aiohttp.AsyncResolver (fix #748)Gravatar MarkKoz-15/+30
AsyncResolver has to be created inside a coroutine so it's moved inside start(). Consequently, the APIClient session is also recreated inside start() now. When using clear(), the default connector is used for the session it recreates because clear() is not a coroutine. This should only affect requests made to the Discord API via the Client when not using it to run a bot; starting the bot will re-create the session with the custom connector. * Close connector and resolver when bot closes
2020-02-13API: accept additional session kwargs for recreate()Gravatar MarkKoz-7/+16
These kwargs are merged with the kwargs given when the APIClient was created. This is useful for facilitating changing the session's connector with a new instance when the session needs to be recreated. * Rename _session_args attribute to _default_session_kwargs
2020-02-12Fix pagniation module for "last page" reactionGravatar mosguinz-1/+1
Fixes #746.
2020-02-09Remove clear reaction from paginatorsGravatar MarkKoz-17/+2
It could be confused with the delete reaction. Clearing reactions manually is rarely a useful feature anyway.
2020-02-07Pin discord.py to 1.3.xGravatar MarkKoz-2/+2
2020-02-07Update discord.py to 1.3.1Gravatar MarkKoz-39/+34
2020-02-06Add missing slash to asking good questions url.Gravatar scragly-1/+1
2020-02-05Move tools and questions guide to under resourcesGravatar scragly-2/+2
After the wiki pages adjustment to the resources page, these two urls are needing to be updated to point to the new correct locations for each page. Tools will be under resources, and Asking Good Questions is a guide, so will be under Guides.
2020-02-05Made searching even stricter by searching from start of each wordGravatar Shirayuki Nekomata-11/+13
- Added regex back to sub and split by non-alphabet. - Now use two pointers to move from words to words.
2020-02-05Removed regex, implemented a stricter letter searching.Gravatar Shirayuki Nekomata-10/+12
2020-02-05Increased default thresholds from just [100, 80] to [100, 90, 80, 70, 60]Gravatar Shirayuki Nekomata-2/+2
- Since it is returning as soon as there are suggestions found for a threshold, this will give a better reflection of what the bot thinks user is searching for.
2020-02-05Removed non-alphabets from both search and tag_name when scoring.Gravatar Shirayuki Nekomata-2/+5
- Added a regex to remove non-alphabet ( `[^a-z]` with `re.IGNORECASE` )
2020-02-04Refactored _get_suggestions following Mark's suggestions about inefficiency.Gravatar Shirayuki Nekomata-12/+24
- Matching scores will be calculated once now and stored in the dict `scores`. - Allow `_get_suggestions()` to go through a list of score threshold and return the first list of matching tags that's not empty and above the threshold. This avoid calling the function multiple time like before ( `self._get_suggestions(tag_name, 100) or self._get_suggestions(tag_name, 80)` for example, is calling this function twice, and is inefficient ) - Deleted commented line. - Added `typing` module for more typehints.
2020-02-04Fixed _last_fetch not being updated after each api call.Gravatar Shirayuki Nekomata-4/+6
- Changed type of `self._last_fetch` to `float` and give it the initial value of `0.0` instead of `None` - Assigned `time.time()` to `time_now` to avoid calling this function twice. - Added `self._last_fetch = time_now` after calling the api call.
2020-02-04Use a trailing underscore to avoid name conflicts. Gravatar scragly-2/+2
Previously used a leading underscore, but that's usually meant for non-used names.
2020-02-03Change typehint name for the attachment-log constantGravatar Matteo Bertucci-1/+1
2020-02-03Replace constant attachment-repost by the actual ID of #attachment-logGravatar Matteo Bertucci-4/+3
2020-02-02Update CODEOWNERSGravatar Joseph-1/+1
2020-02-02Remove prometheus related codeGravatar Joseph Banks-272/+128
2020-02-02Update config-default.ymlGravatar Thomas Petersson-0/+1