aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
* | | | | | | | Changing the prefix and domain backGravatar Leon Sandøy2019-09-15-2/+2
|/ / / / / / /
* | | | | | | Merge branch 'master' of github.com:python-discord/botGravatar Leon Sandøy2019-09-15-1/+1
|\ \ \ \ \ \ \
| * | | | | | | Ship `DEBUG` log messages to the site.Gravatar Johannes Christ2019-09-15-1/+1
| | | | | | | |
* | | | | | | | Setting the config to work with the pydis server.Gravatar Leon Sandøy2019-09-15-422/+63
|/ / / / / / /
* | | | | | | Merge branch 'master' of github.com:python-discord/botGravatar Leon Sandøy2019-09-15-0/+67
|\ \ \ \ \ \ \ | | |/ / / / / | |/| | | | |
| * | | | | | Merge pull request #419 from python-discord/bot-utils-checks-testsGravatar Johannes Christ2019-09-15-0/+67
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Add tests for `bot.utils.checks`.
| | * | | | | | Add tests for `bot.utils.checks`.Gravatar Johannes Christ2019-09-15-0/+67
| | |/ / / / /
* | / / / / / Bot Test Server default config, for testing.Gravatar Leon Sandøy2019-09-15-64/+423
|/ / / / / /
* | | | | | Adding the snekbox URL to the default config, fixing typo.Gravatar Leon Sandøy2019-09-15-2/+2
| | | | | |
* | | | | | Temporarily pointing config at django.pydis.comGravatar Leon Sandøy2019-09-15-2/+2
| |/ / / / |/| | | |
* | | | | Resolves a breaking bug in the Dockerfile.Gravatar Leon Sandøy2019-09-15-10/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using a pipenv run script to launch the bot, but pipenv run scripts assume that the run command will be run inside of a virtual environment. So, the default behaviour when we try to use a run command and no venv exists is to create a venv. Because we were installing all the packages to the local environment by passing the '--system' flag to our install, this would make the bot fail with ImportErrors. This commit fixes it so that the Dockerfile will run the bot using the system Python instead of the pipenv run script.
* | | | | The DockerHub deployment should now run on 'master'Gravatar Leon Sandøy2019-09-15-34/+2
|/ / / /
* | | | Tag Django images as `latest`.Gravatar Johannes Christ2019-09-15-2/+2
| | | |
* | | | Remove most local error handlers & handle InChannelCheckFailure globallyGravatar MarkKoz2019-09-14-81/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add error handler to ignore InChannelCheckFailure in the verification cog * Raise InChannelCheckFailure instead of MissingPermissions in !user * Send message instead of raising BadArgument in !user to prevent help message from being shown in such case * Clean up !user command
* | | | Ignore handled errors by checking for a "handled" attributeGravatar MarkKoz2019-09-14-3/+3
| | | |
* | | | Generate InChannelCheckFailure's message inside the exceptionGravatar MarkKoz2019-09-14-5/+6
| | | | | | | | | | | | | | | | The exception now expects channel IDs to be passed to it.
* | | | Actually fix cog error handler check when command is NoneGravatar MarkKoz2019-09-14-1/+2
| | | |
* | | | Fix deleting already deleted message in antispamGravatar Sebastiaan Zeeff2019-09-15-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since we're in an async context, it can happen that a message was already deleted before the antispam cog could get to it. To prevent processing from stopping dead because of a NotFound exception, I added a try-except and log message to handle that In addition, corrected a small mistake: trying to indice a single Message object. Corrected.
* | | | Fix AntiSpam sending duplicate messages to APIGravatar Sebastiaan Zeeff2019-09-15-49/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot/issues/412 https://github.com/python-discord/bot/issues/410 The AntiSpam cog had a bug that caused it to send the same messages in more than one request to the deleted messages API endpoint. Since the API rejects duplicate messages, all requests containing a duplicate message were rejected, even if the request contained new messages as well. This commit fixes that by gathering up all the messages of a single spam event into a single DeletionContext and sending that instead. This commit also prevents the bot fomr being bricked by a single misconfigured antispam configuration. Instead of raising a bare exception, it will now log the validation error and alert moderation on server that antispam has been disabled. closes #412, closes #410
* | | | Fix cog error handler check when command is NoneGravatar MarkKoz2019-09-14-1/+1
| | | |
* | | | Improve logging of command errorsGravatar MarkKoz2019-09-14-13/+28
| | | |
* | | | Display no-DM error message originating from security cog's global checkGravatar MarkKoz2019-09-14-2/+4
| | | | | | | | | | | | | | | | | | | | The check will behave like Discord.py's guild_only check by raising the NoPrivateMessage exception.
* | | | Ignore errors from cogs with their own error handlersGravatar MarkKoz2019-09-14-5/+13
| | | |
* | | | Fixes a bug syncing roles for members who leave.Gravatar Leon Sandøy2019-09-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The event that was supposed to handle this was called on_member_leave instead of on_member_remove, so the even was never called when it should have been. This commit renames the method.
* | | | Fixes a sneaky genexp exhaustion bug in @without_role.Gravatar Leon Sandøy2019-09-14-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This problem made the decorator only check the first role that was passed into it, instead of checking all the roles. In other words, the check would fail on *STAFF_ROLES unless you had the Helpers role. Solved by refactoring the genexp to a listcomp.
* | | | Improve handling of long deleted messsagesGravatar Sebastiaan Zeeff2019-09-14-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `modlog` cog failed on long messages with attachments, since the inclusion of attachment metadata would bring the length of the embed description to go over the character limit of 2048. To fix this, I moved the addition of the attachment metadata to earlier in the code so it is taken into account for the character limit. In addition to this, I changed the truncation behavior. Instead of just truncating the message if it's too long, we now truncate and upload the full message to the `deleted messages` endpoint so the full message is still available. A link to the log will be included in the message-log embed.
* | | | Fix tag command invocation in aliasesGravatar MarkKoz2019-09-14-2/+2
| | | | | | | | | | | | | | | | Co-authored-by: Leon Sandøy <[email protected]>
* | | | Cogs.reload now has more readable error info.Gravatar Leon Sandøy2019-09-14-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you run '!cogs reload *', the load failures will now include the Exception type, and has overall more readable formatting. Similarly, trying to do '!cogs load <some cog>' on a broken cog will show the Exception type as well.
* | | | Oops, forgot to remove DEVOPS role alias, that would crash the bot.Gravatar Leon Sandøy2019-09-14-1/+0
| | | |
* | | | Merge branch 'django' of github.com:python-discord/bot into djangoGravatar Leon Sandøy2019-09-14-24/+50
|\ \ \ \
| * | | | Deal with multiple active infractions in databaseGravatar Sebastiaan Zeeff2019-09-14-24/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While there are measures to prevent duplicate active infractions at the side of the bot, there's no formal restriction at the sid of the database. This means that it's possible for a user two get two active ban infractions or two active mute infractions at the same time, for instance after a manual table edit in Admin. This leads to an inconsistent state when unmuting/unbanning that user, as the ban or mute role will be removed on Discord, but only one of the entries in the database would be set to inactive, while the other(s) remain active. This means that an unmuted user will be remuted if they leave and rejoin the Guild. To handle this, I've inserted code that sets all the infractions to inactive and cancels all related infraction tasks (in the case of temporary infractions) when issuing an unban or unmute command. A note will be added to the mod_log embed to notify us as well.
* | | | | Nuking Roles.devops and the Deployment cog.Gravatar Leon Sandøy2019-09-14-98/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Deployment cog does not work in our new server environment, nor are we particularly inclined to make it work (for security reasons). For this reason, I've removed it. I've also removed all usages of Roles.devops, replacing them with Roles.core_developer whenever this made sense to do, such as in the Cogs cog.
* | | | Fixes all URLs in the Site cog.Gravatar Leon Sandøy2019-09-14-6/+6
| | | | | | | | | | | | | | | | | | | | This changes URLs for stuff like FAQ, rules, and the Asking Good Questions page to fit the Django format.
* | | | Don't allow tag invocations in #checkpoint.Gravatar Leon Sandøy2019-09-14-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | There was a bug which would permit tag invocations here, because these were triggered by an error handler on CommandNotFound. This commit prevents that from being possible.
* | | | Allow multiple words for !otn aGravatar kosayoda2019-09-14-4/+8
| | | |
* | | | Add more_itertools as a dependencyGravatar kosayoda2019-09-14-21/+31
| | | |
* | | | Merge branch 'django' of github.com:python-discord/bot into djangoGravatar Leon Sandøy2019-09-14-10/+31
|\ \ \ \
| * \ \ \ Merge branch 'django' of github.com:python-discord/bot into djangoGravatar kosayoda2019-09-14-8/+18
| |\ \ \ \
| | * | | | Make ResponseErrorCode handle non-JSON responseGravatar Sebastiaan Zeeff2019-09-14-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit assumed the API respone to always be JSON. This leads to issues when that is not the case, such as when the API is completely unreachable (text/html 404 response). Updated the ResponseErrorCode exception to account for that and updated the moderation util `post_infraction` to reflect that.
| * | | | | Remove duplicate members passed into team creation commandGravatar kosayoda2019-09-14-0/+3
| | | | | |
| * | | | | Add more information to team creation messagesGravatar kosayoda2019-09-14-4/+10
| | | | | |
* | | | | | Nuking the Roles.developer role.Gravatar Leon Sandøy2019-09-14-4/+2
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're not really using this, we're using Roles.verified. This provides superiour readability, and there's no reason we should use two instead of just one. I also added a comment to clarify that this role represents the Developers role on pydis.
* | | | | We now also detect bot tokens outside quotes.Gravatar Leon Sandøy2019-09-14-2/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | Previously, the regex to detect tokens would only trigger on messages where the token was inside of single or double quotes. This commit changes this so that we look for bot tokens regardless of context.
* | | | Adds a !nominees alias.Gravatar Leon Sandøy2019-09-14-0/+8
| | | | | | | | | | | | | | | | | | | | This invokes the `!nomination list` command, showing all currently nominated users.
* | | | Improvements to the Wolfram cog.Gravatar Leon Sandøy2019-09-14-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds clearer error messages for all the errors produced by the Wolfram cog if the API key is missing in the config, or if the key isn't valid anymore. It also humanizes the timedelta returned in the error users get when they run out their cooldown. Instead of telling them they need to wait 84000 seconds, it will now tell them they need to wait 23 hours, 59 minutes ...
* | | | Make 'post_infraction' catch the right exceptionGravatar Sebastiaan Zeeff2019-09-14-11/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The internal 'api' of our API client has changed: It raises a custom RespondeCodeError instead of an `aiohttp.ClientError` when an API was not successful. I updated this utility function to catch the right exception and added handling for unknown users by notifying the user of that problem directly.
* | | | Add API response dict to ResponseCodeErrorGravatar Sebastiaan Zeeff2019-09-14-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ReponseCodeError held a reference to `aiohttp.ResonseObject` to make sure the response data was available. However, the response data is not actually included in the Response Object, but needs to be awaited. Unfortunately, the ResponseCodeError is usually inspected after the connection has been closed, triggering a ClientConnectionError when the data was retrieved. I solved this by adding the awaited reponse data directly to our custom exception by awaiting the response.json() before raising the exception.
* | | | Add error handlers for more command exceptionsGravatar MarkKoz2019-09-13-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MissingPermissions, CheckFailure, DisabledCommand, and CommandOnCooldown will now have a simple message logged. * Log BotMissingPermissions and remove sending missing permissions as a message
* | | | Fix one-off error in the !clean commandGravatar Sebastiaan Zeeff2019-09-13-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/python-discord/bot/issues/413 The message indexing phase of the `!clean` did not account for the presence of the invocation message, resulting in a one-off error in the amount of messages being indexed. Fixed it by adding one to the amount of messages we index from the message history. Closes #413
* | | | Fix bugs and inconsistencies in moderation cogGravatar Sebastiaan Zeeff2019-09-13-154/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes and updates to the moderation cog introduced some inconsistencies that were causing bugs or differences in behavior between very similar commands. I've remedied the problems by: - Consistently making sure we stop if a post_infraction API call fails; - Factoring out the check for active infractions to a utility function; - Updating commands that expected a pre-migration API response format. In addition, I've also added function annotations.