| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| | | |/
| |/|
| | |
| | | |
get_event_loop is deprecated as of 3.10 if there is no running loop.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit provides the basis of the new filtering system:
- The filtering cog consists of several filter lists loaded from the database (filtering.py).
- Each filter list contains a list of filters, which are run in response to events (message posting, reaction, thread creation). Each filter list may choose to respond to different events (the subscribe method in filtering.py).
- Each filter has settings (settings.py) which decide when it is going to be run (e.g it might be disabled in a specific channel), and what will happen if it triggers (e.g delete the offending message).
- Not every filter has a value for every setting (the _settings_types package) . It will use the default settings specified by its filter list as a fallback.
- Since each filter might have a different effect when triggered, we must check all relevant filters even if we found a triggered filter already, unlike in the old system.
- Two triggered filters may specify different values for the same setting, therefore each entry has a rule for combining two different values (the __or__ method in each file in _settings_types).
To avoid having to prefix each file with an underscore (or the bot will try to load it as a cog), the loading script was changed to ignore packages with names starting with an underscore.
Alert sending is done via a webhook so that several embeds can be sent in the same message (will be useful for example for guild invite alerts).
Filter lists and setting entries classes are loaded dynamically from their respective packages.
In order to be able to test the new features, this commit also includes a migration of the regex-based filtering.
|
| |/ /
| |
| |
| | |
Tests and dependent functionality in other extensions will be re-added later on.
|
| | | |
|
| |\ \ |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| |/ / |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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]>
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
Discord.py now implicitly calls the new async cog_load function from within it's internals on load. There is no longer a need to test that this happens.
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |\| | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
Co-authored-by: GDWR <[email protected]>
|
| | | | |
| | | |
| | | |
| | | | |
Co-authored-by: GDWR <[email protected]>
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
There was some redundant pre-processing of arguments happening before
calling `notify_infraction`.
|
| |\ \ \ \
| | |/ /
| |/| | |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This changes all functions that reference voice_ban to voice_mute instead, which comes with breaking front-end changes.
These front end changes are desirable, so that moderators get used to use voice_mute now, rather than voice_ban, in preparation for when we roll out real voice_bans.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit changes all of the back-end so that it is in line with the new site API (see this PR https://github.com/python-discord/site/pull/608).
This comes with no changes to commands, or functions definitions.
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | |
| | | |
| | | | |
As per @Numerlor's suggestion
|
| |\| | |
| | | |
| | | |
| | | | |
feat/timeit-command
|
| | | | |
| | | |
| | | |
| | | |
| | | | |
None was returned for two separate cases: permanent infractions and
expired infractions. This resulted in an ambiguity.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Mock User.created_at and User.joined_at because `arrow.get()` doesn't
work with Mock objects. The old implementation of
`time.discord_timestamp` accepted mocks because it just did `int()` on
any type it didn't explicitly check for.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Remove the need for the caller to create a `relativedelta` from 2
timestamps before calling `humanize_delta`. This is especially
convenient for cases where the original inputs aren't `datetime`s
since `relativedelta` only accepts those.
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Remove the burden of conversion from the caller to clean up and simplify
the call sites. Handle timestamp conversions internally with arrow.get.
Remove format_infraction and get_time_delta because they're now
obsolete. Replace the former with discord_timestamp and the latter with
format_relative.
|
| | | | |
| | | |
| | | |
| | | | |
It's not necessarily tied to infractions anymore.
|
| | | | |
| | | |
| | | |
| | | | |
It's not used anywhere and hasn't been for a very long time.
|
| | | | |
| | | |
| | | |
| | | | |
Since the !eval command is no longer the only snekbox command, make the naming more generic.
|