| Commit message (Collapse) | Author | Age | Lines |
| ... | |
| | | | | | | | |
| | | | | | | |
| | | | | | | | |
Co-authored-by: Boris Muratov <[email protected]>
|
| | | |_|_|_|/ /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Due to the increase in typo-squatting based phishing,
we want to automatically ban users sending specific domain names.
For that, this commit will automatically ban any user that
trigger a filter which has `[autoban]` in its reason. That's it!
|
| | |/ / / / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Occasional hiccups in the Discord API would cause unpinning in help
channel to sometimes fails. This gets around that by unpinning all
messages when making the channel available.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Discussion in the pull request raised some legitimate use cases for supplying a time range for multiple channels (e.g clean the last couple of minutes instead of specifying number of messages to traverse).
|
| | | | | | | |
|
| | | |\ \ \ \
| |_|/ / / /
|/| | | | | |
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Use datetime.fromtimestamp so we pass relativedelta a datetime object…
|
| |/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes #1907
Fixes BOT-1PA
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Use Arrow.fromtimestamp to get an aware datetime
|
| |/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes #1905
Fixes BOT-1P9
datetime.fromtimestamp returned an naive datetime, so when comparing to the aware datetime from dateutil.parser.isoparse, it would raise an error.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
* Move to timezone aware datetimes
With the shift of the discord.py library to timezone aware datetimes, this commit changes datetimes throughout the bot to be in the UTC timezone accordingly.
This has several advantages:
- There's no need to discard the TZ every time the datetime of a Discord object is fetched.
- Using TZ aware datetimes reduces the likelihood of silently adding bugs into the codebase (can't compare an aware datetime with a naive one).
- Our DB already stores datetimes in UTC, but we've been discarding the TZ so far whenever we read from it.
Specific places in the codebase continue using naive datetimes, mainly for UI purposes (for examples embed footers use naive datetimes to display local time).
* Improve ISODateTime converter documentation
Co-authored-by: Kieran Siek <[email protected]>
|
| |\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Modlog: explicitly write thread names
|
| |/ / / / / /
| | | | | |
| | | | | |
| | | | | | |
It seems like there could be some caching issue with threads causing to appear as deleted channels. Beside, we also want to keep the name of deleted threads around.
|
| |\ \ \ \ \ \
| |_|_|_|_|/
|/| | | | | |
Bumps Pip Licences
|
| |/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Updates the pip-licences version to fix a breaking bug in the currently
pinned version.
Signed-off-by: Hassan Abouelela <[email protected]>
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | |\ \ \ |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Added a cog_command_error method that sets cleaning to False when a command ends on an exception.
I don't have anything in mind that might cause this, but it will ensure that in any case the cog will still be usable.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Handle cases where there are no enclosing backticks, and where the regex pattern is invalid.
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
When providing a user ID it would clash with `traverse` which came first.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In case of old messages, it would delete the old messages first, and only then bulk delete the remainder, which affected logging.
This commit corrects the deletion order.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Tells the user if clean cancel was attempted with no ongoing clean.
- Fixes MaxConcurrencyReached call bug. There was a missing argument, and it shouldn't invoke the help embed anyway, so it's now a message.
- Some code refactoring.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The regex was lowercased, even though regex patterns are case sensitive.
Also adds the DOTALL flag.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Co-authored-by: Shivansh-007 <[email protected]>
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
After discussion, backticks seems like the preferrable formatting as it also cancels Discord's formatting.
Additionally removed the Optionals from the last args in the commands, to not silently ignore incorrect input.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Cleaning in the same time range across several channels seems like an arbitrary decision.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The subcommands are kept simple and with few arguments, as they deal with most cases and their usage shouldn't be cumbersome.
However we might to clean by criteria of several functionalities offered by the subcommands, for example delete a specific user's messages but only those that contain a certain pattern.
For this reason the top-level command can now accept all arguments available in any of the subcommands, and will combine the criteria.
Because the channels list has to be the last argument in order to accept either a list of channel or "*", I had to force a specific pattern in the regex argument for it to not consume the first channel specified.
The regex argument must now have an "r" prefix and be enclosed in single quotes. For example: r'\d+'. For patterns with spaces the whole thing still needs to be enclosed in double quotes.
For consistency the `clean regex` subcommand was changed to require the same.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The subcommands should stay simple and answer the most common use cases.
Deleting all messages within a time range across many channels seems esoteric and gives just more room for mistakes.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- The two subcommands can now accept a time delta and an ISO date time in addition to messages.
- The two limits are now exclusive. Meaning cleaning until a message will not delete that message.
- Added a separate predicate for the `until` case, as the combination of that command and cache usage would result in incorrect behavior.
Additionally, deleting from cache now correctly traverses only `traverse` messages, rather than trying to delete `traverse` messages.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit changes the clean command to send a message instead of raising BadArgument when no messages are found.
Not finding messages is not an error, and doesn't necessarily require the help embed to spring up, just that the parameters might need tweaking.
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit further splits the bulky _clean_messages function, and all its helper functions are grouped together in the same region.
Additionally, this commit fixes logging by logging only the messages that have been successfully deleted, before being possibly interrupted by the cancel command.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This name as been confusing moderators for a while now.
"amount" sounds like this is the amount of messages that the bot will try to delete, and keep going until it reaches that number.
In reality it's the amount of latest messages per channel the bot will traverse.
Hopefully the new name conveys that better.
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The cache is used only when all channels are used, as before.
Unlike before, using all channels requires using "*" in the channels argument. Before all channels would be used if use_cache was set to True.
Using all channels uses the cache by default. To traverse every single text channel in the server, setting use_cache to False is required in the command.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
Between the concurrency check and setting the cleaning flag to True there was an await statement, which could potentially cause race conditions.The setting of the flag was moved to right below the concurrency check.
|
| | | | | | | |
|
| | | | | | |
| | | | | |
| | | | | |
| | | | | | |
The cog is moderation related and all commands are exclusive to moderators.
|
| | | |\ \ \ \ |
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | | |
|