aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | * | | | | | | Change to explicit logs, remove logmatic.Gravatar scragly2020-02-20-160/+76
| |/ / / / / / /
| * | | | | | | Merge pull request #753Gravatar S. Co12020-02-19-16/+38
| |\ \ \ \ \ \ \ | | |_|/ / / / / | |/| | | | | | Show created date and duration in expired infraction log
| | * | | | | | Merge branch 'master' into feat/frontend/b685/expired-infraction-log-durationGravatar S. Co12020-02-19-1/+1
| | |\ \ \ \ \ \ | | |/ / / / / / | |/| | | | | |
| | * | | | | | Moderation: show avatar in infraction deactivation logGravatar MarkKoz2020-02-19-0/+5
| | | | | | | |
| | * | | | | | Moderation: show member as a mention in expired infraction logGravatar MarkKoz2020-02-15-1/+1
| | | | | | | |
| | * | | | | | Moderation: show correct actor in expired infraction logGravatar MarkKoz2020-02-15-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bot user was always being used instead of using the actor field of the infraction.
| | * | | | | | Moderation: add creation date & duration to expired infraction logGravatar MarkKoz2020-02-15-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #685
| | * | | | | | Utils: refactor format_infraction_with_duration and support absolute valGravatar MarkKoz2020-02-15-13/+23
| | | |_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The absolute value is useful for preventing negative values in the case that date_to is in the past relative to date_from. * Add an absolute parameter to take the absolute value of the duration * Rename expiry to date_to * Rewrite the docstring
| | | * | | | Add unit test for newlines antispam ruleGravatar kwzrd2020-02-04-0/+105
| | | | | | |
| | | * | | | Add unit test for duplicates antispam ruleGravatar kwzrd2020-02-04-0/+66
| | | | | | |
| | | * | | | Merge branch 'master' into unittest-antispam-rulesGravatar Joseph2020-02-02-1/+10
| | | |\ \ \ \
| | | * | | | | Make RuleTest use ABCMetaGravatar kwzrd2020-02-02-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will prevent child classes to be instantiated unless they implement all abstract methods, leading to a more descriptive error message.
| | | * | | | | Adjust existing tests to inherit from RuleTest ABCGravatar kwzrd2020-02-02-294/+157
| | | | | | | |
| | | * | | | | Implement RuleTest ABCGravatar kwzrd2020-02-02-0/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will serve as an ABC for tests for individual rules. The base class provides runners for allowed and disallowed cases, and the children classes then only provide the cases and implementations of helper methods specific to each rule.
| | | * | | | | Adjust multi-line docstrings to prevailing styleGravatar kwzrd2020-01-31-3/+6
| | | | | | | |
| | | * | | | | Refactor msg helper function name to make_msgGravatar kwzrd2020-01-26-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The name msg is less descriptive and creates a needless name conflict in local gen exp.
| | | * | | | | Fix incorrect config key in attachments antispam ruleGravatar kwzrd2020-01-26-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rule was incorrectly printing out the maximum amount of allowed attachments instead of the configured interval. This commit also adjusts the rule's unit test case.
| | | * | | | | Add unit test case for role mentions antispam ruleGravatar kwzrd2020-01-26-0/+66
| | | | | | | |
| | | * | | | | Add unit test case for discord emojis antispam ruleGravatar kwzrd2020-01-26-0/+68
| | | | | | | |
| | | * | | | | Add unit test case for chars antispam ruleGravatar kwzrd2020-01-26-0/+75
| | | | | | | |
| | | * | | | | Add unit test case for burst shared antispam ruleGravatar kwzrd2020-01-26-0/+65
| | | | | | | |
| | | * | | | | Add unit test case for burst antispam ruleGravatar kwzrd2020-01-26-0/+69
| | | | | | | |
| | | | | | | * Error handler: handle CommandOnCooldown errorsGravatar MarkKoz2020-02-16-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simply send the error's default message to the invoking context.
| | | | | | | * Error handler: update docstrings to reflect recent changesGravatar MarkKoz2020-02-16-20/+39
| | | | | | | |
| | | | | | | * Error handler: simplify check failure handler & handle bot missing rolesGravatar MarkKoz2020-02-16-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | discord.py's default error messages are quite descriptive already so there really isn't a need to write our own. Therefore, the log calls were removed so that the generic debug log message is used in the on_command_error. In addition to handling missing bot permissions, missing bot roles are also handled. The message doesn't specify which because it doesn't really matter to the end-user. The logs will use the default error messages as described above, and those will contain the specific roles or permissions that are missing.
| | | | | | | * Error handler: (almost) always log the error being handledGravatar MarkKoz2020-02-16-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The log level is debug for most errors and it's mainly useful for precisely that - debugging. This is why some "useless" errors are also logged e.g. CommandNotFound. Unexpected errors and some API errors will still have higher levels. * Add a single log statement to the end of the handler to cover UserInputError, CheckFailure, and CommandNotFound (when it's not trying to get a tag) * Log 404s from API
| | | | | | | * Error handler: handle ArgumentParsingErrorGravatar MarkKoz2020-02-16-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simply send the error message with the help command.
| | | | | | | * Error handler: handle BadUnionArgumentGravatar MarkKoz2020-02-16-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send a message specifying the parameter name, the converters used, and the last error message from the converters.
| | | | | | | * Error handler: handle TooManyArgumentsGravatar MarkKoz2020-02-16-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send a message specifying the error reason.
| | | | | | | * Error handler: handle MissingRequiredArgumentGravatar MarkKoz2020-02-16-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Send a message indicating which argument is missing.
| | | | | | | * Error handler: simplify error importsGravatar MarkKoz2020-02-16-29/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Import the errors module and qualify the error types with it rather than importing a large list of error types.
| | | | | | | * Error handler: create separate function to handle UserInputErrorGravatar MarkKoz2020-02-16-12/+17
| | | | | | | |
| | | | | | | * Error handler: move help command retrieval to a separate functionGravatar MarkKoz2020-02-16-11/+18
| | | | | | | |
| | | | | | | * Error handler: move tag retrieval to a separate functionGravatar MarkKoz2020-02-16-18/+28
| | | | | | | |
| | | | | | | * Error handler: log unhandled exceptions instead of re-raisingGravatar MarkKoz2020-02-16-2/+2
| | | | | | | |
| | | | | | | * Error handler: create separate function to handle ResponseCodeErrorGravatar MarkKoz2020-02-16-14/+17
| | | | | | | |
| | | | | | | * Error handler: create separate function to handle CheckFailureGravatar MarkKoz2020-02-16-15/+29
| | | | | | | |
| | | | | | | * Moderation: fix member not found error not being shownGravatar MarkKoz2020-02-16-1/+1
| | | |_|_|_|/ | | |/| | | |
* | | | | | | Ignore NotFound errors inside continue_evalGravatar Matteo2020-02-28-24/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It could have caused some errors if the user delete his own message
* | | | | | | Return only the new code in continue_eval and check for truthiness insteadGravatar Matteo2020-02-28-11/+10
| | | | | | |
* | | | | | | Use unicode code point instead of literal for the snekbox re-eval emojiGravatar Matteo2020-02-27-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unicode literals aren't really safe compared to code points
* | | | | | | Split the eval command procedure into two functions.Gravatar Matteo2020-02-27-114/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Two functions were created: send_eval and continue_eval, in order to facilitate testing. The corresponding tests are also changed in this commit.
* | | | | | | Merge branch 'master' into eval-enhancementsGravatar Matteo Bertucci2020-02-18-379/+350
|\| | | | | |
| * | | | | | Change snekbox api url to internal docker domain.Gravatar scragly2020-02-17-1/+1
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGINX has been dockerised, and proxy passes now reference internal container domains rather than referencing host or external domains. This will have a few extra benefits: - Less external factors involved for resolving the service address - Can work with the same address on development envs - Snekbox can be closed down entirely so it's inaccessible from external networks.
| * | | | | Merge pull request #752 from python-discord/infr-edit-permanent-fixGravatar Mark2020-02-14-2/+5
| |\ \ \ \ \ | | |_|_|_|/ | |/| | | | Stop scheduling expiration of permanent infractions on edit
| | * | | | Stop scheduling expiration of permanent infractions on editGravatar Sebastiaan Zeeff2020-02-14-2/+5
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot/issues/751 The infraction edit command defined in `bot.cogs.moderation.management` contained a bug causing it to attempt to schedule an expiration task when turning a temporary infraction into a permanent infraction. Since the "expires_at" field of a permanent infractions is `None`, this caused an exception to occur in the scheduler: Traceback (most recent call last): File "/bot/bot/cogs/moderation/scheduler.py", line 415, in _scheduled_task expiry = dateutil.parser.isoparse(infraction["expires_at"]).replace(tzinfo=None) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 37, in func return f(self, str_in, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 134, in isoparse components, pos = self._parse_isodate(dt_str) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 208, in _parse_isodate return self._parse_isodate_common(dt_str) File "/usr/local/lib/python3.7/site-packages/dateutil/parser/isoparser.py", line 213, in _parse_isodate_common len_str = len(dt_str) TypeError: object of type 'NoneType' has no len() I have solved this by adding a check that makes sure we only schedule an expiration task when the `"expires_at"` field has a truthy value (which all valid datetime strings are) using `if request_data['expires_at']`. IMPORTANT NOTE: While it's tempting to just skip the entire scheduling block for permanent infractions, it's essential to unschedule existing expiration tasks for this infraction as we're changing a temporary infraction to a permanent infraction. This commit closes #751
| * | | | Merge pull request #747 from mosguinz/pagniation-fixGravatar Sebastiaan Zeeff2020-02-12-1/+1
| |\ \ \ \ | | | | | | | | | | | | Fix pagniation module for "last page" reaction
| | * | | | Fix pagniation module for "last page" reactionGravatar mosguinz2020-02-12-1/+1
| |/ / / / | | | | | | | | | | | | | | | Fixes #746.
| * | | | Merge pull request #625 from python-discord/emoji-cleanupGravatar Mark2020-02-09-14/+19
| |\ \ \ \ | | | | | | | | | | | | Separate message/embed deletion and reaction deletion emojis
| | * | | | Remove clear reaction from paginatorsGravatar MarkKoz2020-02-09-17/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It could be confused with the delete reaction. Clearing reactions manually is rarely a useful feature anyway.