| Commit message (Collapse) | Author | Age | Lines |
|
|
|
| |
In many cases the Guild mock is not needed so this makes tests faster
|
| |
|
|
|
|
|
|
|
| |
* Fix test warnings
* Remove unnecessary event_loop parameters
This is not necessary as the current event loop will be used which is the same as self.bot.loop. Removing these should slightly improve test speed as the mock for self.bot.loop doesn't need to be created.
|
| |
|
|
|
|
| |
The new d.py Member.get_role uses the Guild.get_role function if the member has the role. SInce we don't set Guild.roles overwrite this instead.
|
| |
|
|
|
|
|
| |
Co-authored-by: Boris Muratov <[email protected]>
Co-authored-by: wookie184 <[email protected]>
|
|\ |
|
| |
| |
| |
| |
| | |
The value 2 represents the `COMPLETED_ONBOARDING` flag, found here
https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags
|
| |
| |
| |
| |
| |
| |
| |
| | |
+ Remove commented code
+ Remove unecessarily syncting the bot
+ Handle direct tag commads
+ 3.10 type hinting in concerned functions
+ Add `MockInteractionMessage`
+ Fix tests for `try_get_tag`
|
| | |
|
| | |
|
| | |
|
|\| |
|
| |
| |
| | |
The attribute was removed from Bot in fc05849
|
| |
| |
| |
| |
| | |
Co-authored-by: Izan <[email protected]>
Co-authored-by: TizzySaurus <[email protected]>
Co-authored-by: Xithrius <[email protected]>
|
|/
|
|
|
| |
The channel scope settings were changed to accomodate strings. That means that if a string is specified, the bot will look whether the context channel's name matches. If it's a number, it will match the ID.
Accordingly the same changed was applied to the bypass roles and pings settings: if it's a non-numeric string, it will look for a role with that name.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The user syncer was blocking the startup of the sync cog due to having
to perform thousands of pointless member fetch requests. This speeds up
that process by increasing the probability that the cache is up-to-date
using `Guild.chunked`, and limiting the fetches to members who were in
the guild during the previous sync only.
Co-authored-by: ChrisJL <[email protected]>
Co-authored-by: wookie184 <[email protected]>
Signed-off-by: Hassan Abouelela <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
region was removed from the guild object, so this has been replaced with features
add_cog is now async, so it is now an async_mock during tests
Two new required voice_channel attrs were added
channel.type is required to be set to ChannelType due to a new isinstance check in d.py
|
| |
|
|
|
|
| |
We now source them from bot-core, so no need to have them here too.
|
|
|
|
| |
This reverts commit 960619c23300c56c8aaa454edc7241e2badf80ad.
|
|
|
|
| |
All of the tag content is out of scope for this PR.
|
|\ |
|
| |\ |
|
| | |
| | |
| | |
| | |
| | | |
The util attaches an error logging callback instead of relying on python's
exception logging which only occurs when the task is destroyed
|
| |/ |
|
|/
|
|
|
|
|
|
| |
Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case).
This commits fixes any problem related to the migration:
- New avatar interface
- TZ aware datetimes
- Various inernal API changes
|
|\ |
|
| | |
|
|\| |
|
| |\ |
|
| |\ \ |
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | | |
Added `invoked_from_error_handler` attribute that is `False` default.
|
|\ \ \ \ \
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Signed-off-by: Hassan Abouelela<[email protected]>
# Conflicts
# bot/exts/moderation/silence.py
# bot/exts/moderation/test_silence.py
|
| | |_|/
| |/| | |
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
Adds tests for helper functions in the silence cog.
Signed-off-by: Hassan Abouelela <[email protected]>
|
|\ \ \
| | |/
| |/| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
I've migrated our redis caches over to the async-rediscache package that
we've recently released (https://git.pydis.com/async-rediscache). The
main functionality remains the same, although the package handles some
things, like getting the active session, differently internally.
The main changes you'll note for our bot are:
- We create a RedisSession instance and ensure that it connects before
we even create a Bot instance in `__main__.py`.
- We are now actually using a connection pool instead of a single
connection.
- Our Bot subclass now has a new required kwarg: `redis_session`.
- Bool values are now properly converted to and from typestrings.
In addition, I've made sure that our MockBot passes a MagicMock for the
new `redis_session` kwarg when creating a Bot instance for the spec_set.
Signed-off-by: Sebastiaan Zeeff <[email protected]>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Not everything that's decorated needs the mocks that are patched. Being
required to add the args to the test function anyway is annoying. It's
especially bad if trying to decorate an entire test suite, as every
test would need the args.
Move the definition to a separate module to keep things cleaner.
|
|\ \
| | |
| | |
| | | |
bug/filters/928/non-ascii-token
|
| |\ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Forgot to update the additional_spec_asyncs when changing the name of
this Bot attribute to be public.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
It's not feasible to mock it because all the commands return futures
rather than being coroutines, so they cannot automatically be turned
into AsyncMocks. Furthermore, no code should ever use the redis session
directly besides RedisCache. Since the tests for RedisCache already use
fakeredis, there's no use in trying to mock redis in MockBot.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The .set and .get will accept ints, floats, and strings. These will be
converted into "typestrings", which is basically just a simple format
that's been invented for this object.
For example, an int looks like `b"i|2423"`. Note how it is still stored
as a bytestring (like everything in Redis), but because of this prefix
we are able to coerce it into the type we want on the way out of the db.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This will help catch anything that tries to get/set an attribute/method
which doesn't exist. It'll also catch missing/too many parameters being
passed to methods.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Because some of the redis pool/connection methods return futures rather
than being coroutines, the redis pool had to be mocked using the
CustomMockMixin so it could take advantage of `additional_spec_asyncs`
to use AsyncMocks for these future-returning methods.
|