aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* 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
|\
| * Added bot variables tag (#1784)Gravatar Hunter28072021-08-27-0/+23
| | | | | | | | | | * Added a new tag with the name bot_var Co-authored-by: Bluenix <[email protected]>
| * Merge pull request #1778 from python-discord/update-remind-helpGravatar Xithrius2021-08-26-4/+48
| |\ | | | | | | Add time units and example to docstring of `!remind` commands
| | * Merge branch 'main' into update-remind-helpGravatar Xithrius2021-08-26-2/+9
| | |\ | | |/ | |/|
| * | Merge pull request #1785 from python-discord/Output-public-url-when-sharingGravatar Matteo Bertucci2021-08-26-1/+3
| |\ \ | | | | | | | | Use publicly available URL when outputting metabase share URL
| | * | Use publically available URL when outputting metabase share URLGravatar Chris Lovering2021-08-26-1/+3
| |/ / | | | | | | | | | | | | | | | In production we use the internal URL to call the metabase API, to avoid egress but we still want to output the public url when giving the sharing link. Making it a constant like this makes it easier to change/overwrite in future if needed.
| * | Merge pull request #1783 from python-discord/user-message-link-supportGravatar Matteo Bertucci2021-08-26-1/+6
| |\ \ | | | | | | | | Add message link support to `!user`
| | * | Add message link support to `!user` commandGravatar Izan2021-08-26-1/+6
| |/ /
| | * Add time units to the `!remind edit` and `!remind edit duration` help messagesGravatar Izan2021-08-25-2/+24
| | |
| | * Add time units and example to docstring of `!remind` and `!remind new`Gravatar Izan2021-08-25-2/+24
| |/ | | | | | | Supported time units and an example invocation are now displayed in the help message for `!remind` and `!remind new`
| * Merge pull request #1777 from python-discord/mbaruh-patch-1Gravatar ChrisJL2021-08-25-2/+2
| |\ | | | | | | Fix antispam looking at wrong messages
| | * Fix antispam looking at wrong messagesGravatar Boris Muratov2021-08-24-2/+2
| |/
| * Merge pull request #1731 from Numerlor/converter-typehintsGravatar ChrisJL2021-08-24-128/+96
| |\ | | | | | | Add converter typehints
| | * Merge branch 'main' into converter-typehintsGravatar ChrisJL2021-08-24-37/+75
| | |\ | | |/ | |/|
| * | Merge pull request #1776 from python-discord/community-partners-accessGravatar Matteo Bertucci2021-08-24-26/+36
| |\ \ | | | | | | | | Give partners and community members more access
| | * | Fix testsGravatar Izan2021-08-24-2/+2
| | | |
| | * | Fix lintingGravatar Izan2021-08-24-1/+1
| | | |
| | * | Merge remote-tracking branch 'origin/community-partners-access' into ↵Gravatar Izan2021-08-24-108/+610
| | |\ \ | | | | | | | | | | | | | | | community-partners-access
| | | * \ Merge branch 'main' into community-partners-accessGravatar TizzySaurus2021-08-24-108/+610
| | | |\ \ | | |_|/ / | |/| | |
| * | | | Merge pull request #1700 from python-discord/enhance/1683/restrict-int-evalGravatar Matteo Bertucci2021-08-24-3/+9
| |\ \ \ \ | | | | | | | | | | | | Restrict internal eval command to bot owner when in debug mode
| | * \ \ \ Merge branch 'main' into enhance/1683/restrict-int-evalGravatar Matteo Bertucci2021-08-24-774/+1609
| | |\ \ \ \ | | |/ / / / | |/| | | |
| * | | | | Merge pull request #1775 from python-discord/TizzySaurus-patch-1Gravatar Matteo Bertucci2021-08-24-3/+3
| |\ \ \ \ \ | | | | | | | | | | | | | | Update nomination messages to display user mention
| | * | | | | Update nomination messages to display user mentionGravatar TizzySaurus2021-08-24-3/+3
| |/ / / / /