aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | | | | Filtering: update auto-ban messageGravatar Matteo Bertucci2021-10-19-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Boris Muratov <[email protected]>
| * | | | | | | Filtering: add autoban on specific reasonsGravatar Matteo Bertucci2021-10-19-0/+28
| | |_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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!
| | * | | | | Unpin All Messages When Moving Help ChannelsGravatar Hassan Abouelela2021-10-24-3/+9
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
| | * | | | Remove channel limitation with time rangeGravatar mbaruh2021-10-25-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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).
| | * | | | Update Age converter to use TZ aware datetimeGravatar mbaruh2021-10-25-1/+1
| | | | | |
| | * | | | Merge branch 'main' into cleanreworkGravatar mbaruh2021-10-25-221/+255
| | |\ \ \ \ | |_|/ / / / |/| | | | |
* | | | | | Merge pull request #1908 from python-discord/fix-tz-issueGravatar Hassan Abouelela2021-10-23-2/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use datetime.fromtimestamp so we pass relativedelta a datetime object…
| * | | | | | Use datetime.fromtimestamp so we pass relativedelta a datetime object, not ArrowGravatar Chris Lovering2021-10-22-2/+5
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Fixes #1907 Fixes BOT-1PA
* | | | | | Merge pull request #1906 from python-discord/fix-tzinfo-issueGravatar Hassan Abouelela2021-10-23-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use Arrow.fromtimestamp to get an aware datetime
| * | | | | | Use Arrow.fromtimestamp to get an aware datetimeGravatar Chris Lovering2021-10-22-2/+2
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (#1895)Gravatar Boris Muratov2021-10-22-113/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]>
* | | | | | Merge pull request #1904 from python-discord/modlog/explicit-thread-nameGravatar ChrisJL2021-10-22-3/+12
|\ \ \ \ \ \ | | | | | | | | | | | | | | Modlog: explicitly write thread names
| * | | | | | Modlog: explicitly write thread namesGravatar Matteo Bertucci2021-10-22-3/+12
|/ / / / / / | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #1902 from python-discord/bump-licensesGravatar Matteo Bertucci2021-10-21-88/+95
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | Bumps Pip Licences
| * | | | | Bumps Pip LicencesGravatar Hassan Abouelela2021-10-22-88/+95
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates the pip-licences version to fix a breaking bug in the currently pinned version. Signed-off-by: Hassan Abouelela <[email protected]>
| | * | | Improve documentation of global variablesGravatar mbaruh2021-10-25-3/+5
| | | | |
| | * | | Apply requested style changesGravatar mbaruh2021-10-25-6/+4
| | | | |
| | * | | Adjust docstring to #1876Gravatar mbaruh2021-10-25-12/+11
| | | | |
| | * | | Merge branch 'main' into cleanreworkGravatar mbaruh2021-10-17-1144/+1955
| | |\ \ \
| | * | | | Indentation, type-hint, and documentation fixesGravatar mbaruh2021-09-20-31/+32
| | | | | |
| | * | | | End clean on unexpected errorsGravatar mbaruh2021-09-11-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Regex converter errorsGravatar mbaruh2021-09-11-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | Handle cases where there are no enclosing backticks, and where the regex pattern is invalid.
| | * | | | Fix incorrect cache usageGravatar mbaruh2021-09-08-1/+1
| | | | | |
| | * | | | Switch `users` and `traverse` in main commandGravatar mbaruh2021-09-08-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | When providing a user ID it would clash with `traverse` which came first.
| | * | | | Fix delete orderGravatar mbaruh2021-09-07-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Improve responsesGravatar mbaruh2021-09-07-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
| | * | | | Fix regex searchGravatar mbaruh2021-09-07-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regex was lowercased, even though regex patterns are case sensitive. Also adds the DOTALL flag.
| | * | | | Code and comments polishGravatar mbaruh2021-09-07-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Shivansh-007 <[email protected]>
| | * | | | Changed regex formatting to wrapped in backticksGravatar mbaruh2021-08-31-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Disallow time range cleaning in multiple channelsGravatar mbaruh2021-08-31-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Cleaning in the same time range across several channels seems like an arbitrary decision.
| | * | | | Added master commandGravatar mbaruh2021-08-29-74/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Handle reacted message being deletedGravatar mbaruh2021-08-29-1/+3
| | | | | |
| | * | | | Use a cog-wide role checkGravatar mbaruh2021-08-29-8/+4
| | | | | |
| | * | | | Restrict until and between to a single channelGravatar mbaruh2021-08-29-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | `until` and `between` overhaulGravatar mbaruh2021-08-29-53/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
| | * | | | Send message when no messages foundGravatar mbaruh2021-08-28-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Add checkmark after command completes in mod channelsGravatar mbaruh2021-08-28-1/+4
| | | | | |
| | * | | | Refactor code, correct loggingGravatar mbaruh2021-08-28-96/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Rename "amount" argument to "traverse"Gravatar mbaruh2021-08-28-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Change cache usageGravatar mbaruh2021-08-28-18/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Don't delete clean cancel embed in mod channelGravatar mbaruh2021-08-27-1/+4
| | | | | |
| | * | | | Change `from-to` primary name to `between`Gravatar mbaruh2021-08-27-2/+2
| | | | | |
| | * | | | Correct logging commentGravatar mbaruh2021-08-27-1/+1
| | | | | |
| | * | | | Move setting cleaning flag to correct lineGravatar mbaruh2021-08-27-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | Move clean logging to a helper functionGravatar mbaruh2021-08-27-11/+11
| | | | | |
| | * | | | Moved clean cog to moderation extGravatar mbaruh2021-08-27-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | The cog is moderation related and all commands are exclusive to moderators.
| | * | | | Merge branch 'main' into cleanreworkGravatar mbaruh2021-08-27-933/+1826
| | |\ \ \ \
| | * | | | | Fix references to kwarg after renaming in clean commandGravatar Chris Lovering2021-07-28-2/+2
| | | | | | |
| | * | | | | Rely on error handler for sending input errors to userGravatar Chris Lovering2021-07-28-45/+9
| | | | | | |
| | * | | | | simplify range predicate for clean commandGravatar Chris Lovering2021-07-28-1/+1
| | | | | | |