aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | | | | | | | | * | | | | | | | | Use await instead of asyncio.run in converter testsGravatar MarkKoz2020-04-28-28/+27
| | | | | | | | | | | | | | | | | |
| | | | | | | | | * | | | | | | | | Remove redundant parenthesis from test valuesGravatar MarkKoz2020-04-28-19/+19
| | | | | | | | | | | | | | | | | |
| | | | | | | | | * | | | | | | | | Test for out of range datetime in the Duration converterGravatar MarkKoz2020-04-28-0/+11
| | | | | | | | | | | | | | | | | |
| | | | | | | | | * | | | | | | | | Converters: handle ValueError when year for duration is out of rangeGravatar MarkKoz2020-04-25-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `datetime` objects only support a year up to 9999. Fixes #906
| | | | | | | | | | * | | | | | | | Filtering: Add user avatar thumbnail to nickname alert embedGravatar ks1292020-06-11-1/+2
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | Filtering: Use walrus for better looking of codeGravatar ks1292020-06-11-4/+2
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | Filtering: Fix nickname filter alert sending spacesGravatar ks1292020-06-11-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Joseph Banks <[email protected]>
| | | | | | | | | | * | | | | | | | Filtering: Fix some commentsGravatar ks1292020-06-11-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Joseph Banks <[email protected]>
| | | | | | | | | | * | | | | | | | Remove redis namespace collision testGravatar MarkKoz2020-05-31-10/+0
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | Remove redis namespace collision preventionGravatar MarkKoz2020-05-31-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cogs reload, it would consider their namespace as a conflict with the original namespace. This feature will be removed as a fix until we come up with a better solution.
| | | | | | | | | | * | | | | | | | Add logging for the bad nickname filterGravatar MarkKoz2020-05-31-0/+2
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | Fix missing await in bad nickname filterGravatar MarkKoz2020-05-31-18/+17
| | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | Filtering: Small fixesGravatar ks1292020-05-31-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use UTC from timestamp - Rename name bad words checking function
| | | | | | | | | | * | | | | | | | Filtering: Fix docstringGravatar ks1292020-05-31-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Mark <[email protected]>
| | | | | | | | | | * | | | | | | | Merge remote-tracking branch 'origin/bad-words-nick' into bad-words-nickGravatar ks1292020-05-31-4/+1
| | | | | | | | | | |\ \ \ \ \ \ \ \
| | | | | | | | | | | * | | | | | | | Filtering: Create lock in `__init__`Gravatar ks1292020-05-30-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move lock creation from `bad_words_in_name` to `__init__`
| | | | | | | | | | * | | | | | | | | Filtering: Split name filtering to smaller functionsGravatar ks1292020-05-31-11/+24
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | | Filtering: On name filtering, replace Message with Embed as argumentGravatar ks1292020-05-31-7/+7
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | | Filtering: Add days between alerts as constantGravatar ks1292020-05-31-1/+3
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | | Filtering: Rename `bad_words_in_name` to `check_is_bad_words_in_name`Gravatar ks1292020-05-31-2/+2
| | | | | | | | | | | | | | | | | | |
| | | | | | | | | | * | | | | | | | | Filtering: Use POSIX instead ISO format to storage alert cooldownsGravatar ks1292020-05-31-3/+2
| | | | | | | | | | |/ / / / / / / /
| | | | | | | | | | * | | | | | | | Filtering: Refactor bad names checkingGravatar ks1292020-05-29-31/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Make `bad_words_in_name` and attach it to current `on_message`. - Implement `asyncio.Lock` to avoid race conditions. - Made that this first check is there matches and when there is, check for alert.
| | | | | | | | | | * | | | | | | | Filtering: Implement bad words detection in nicknamesGravatar ks1292020-05-29-0/+41
| | | | | | | | |_|/ / / / / / / / | | | | | | | |/| | | | | | | | |
* | | | | | | | | | | | | | | | | Merge branch 'master' into truncate-internal-evalGravatar Numerlor2020-05-30-963/+2140
|\| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Merge pull request #965 from Akarys42/patch-1Gravatar Dennis Pham2020-05-29-0/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|/ / / / / / / / / / / / | |/| | | | | | | | | | | | | | | Ignore response when posting python news
| | * | | | | | | | | | | | | | | Merge branch 'master' into patch-1Gravatar Dennis Pham2020-05-29-31/+8
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / / | |/| | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Merge pull request #966 from python-discord/sebastiaan/help-channels/ratelimitsGravatar Joseph Banks2020-05-29-31/+8
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ / / / / / / / / / | |/| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | | Reduce the number of help channel name changesGravatar Sebastiaan Zeeff2020-05-29-29/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discord has introduced a new, strict rate limit for individual channel edits that reduces the number of allow channel name/channel topic changes to 2 per 10 minutes per channel. Unfortunately, our help channel system frequently goes over that rate limit as it edits the name and topic of a channel on all three "move" actions we have: to available, to occupied, and to dormant. In addition, our "unanswered" feature adds another channel name change on top of the move-related edits. That's why I've removed the topic/emoji changing features from the help channel system. This means we now have a generic topic that fits all three categories and no status emojis in the channel names.
| | * | | | | | | | | | | | | | | Fix `check_for_answer` breaking on missing cacheGravatar Sebastiaan Zeeff2020-05-29-2/+5
| |/ / / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `check_for_answer` method of the HelpChannels cog relies on the channel->claimant cache being available. However, as this cache is (currently) lost during bot restarts, this method may fail with a KeyError exception. I've used `dict.get` with an `if not claimant: return` to circumvent this issue.
| | * / / / / / / / / / / / / / Ignore response when posting python newsGravatar Matteo Bertucci2020-05-29-0/+1
| |/ / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes a mailing list user doesn't press respond correctly to the email, and so a response is sent as a separate thread. To keep only new threads in the channel, we need to ignore those.
| * | | | | | | | | | | | | | Merge pull request #947 from python-discord/redis_persistenceGravatar Sebastiaan Zeeff2020-05-28-182/+1061
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RedisCache - Data Persistence
| | * | | | | | | | | | | | | | Move the `self.redis_closed` into session create.Gravatar Leon Sandøy2020-05-28-1/+1
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Prevent a state where a coro could wait forever.Gravatar Leon Sandøy2020-05-28-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This addresses a review comment by @aeros.
| | * | | | | | | | | | | | | | Add custom exceptions for each error state.Gravatar Leon Sandøy2020-05-28-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bot can get into trouble in three distinct ways: - It has no Bot instance - It has no namespace - It has no parent instance. These happen only if you're using it wrong. To make the test more precise, and to add a little bit more readability (RuntimeError could be anything!), we'll introduce some custom exceptions for these three states. This addresses a review comment by @aeros.
| | * | | | | | | | | | | | | | Make prefix consts private and more precise.Gravatar Leon Sandøy2020-05-28-9/+9
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Reduce complexity on some of the typestring stuff.Gravatar Leon Sandøy2020-05-28-31/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Refactor error messages in _to_typestring and _from_typestring to just print the prefix tuples instead of that custom error string. - Create a RedisKeyOrValue type to simplify some annotations. - Simplify partialmethod calls. - Make the signatures for _to_typestring and _from_typestring one-liners - Fix a typo in the errors.
| | * | | | | | | | | | | | | | Merge branch 'master' into redis_persistenceGravatar Leon Sandøy2020-05-27-80/+154
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / | |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Merge pull request #961 from ↵Gravatar Sebastiaan Zeeff2020-05-27-88/+161
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|/ / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | python-discord/moderation_commands_in_modmail_category Permit moderation commands in ModMail category
| | * | | | | | | | | | | | | | Add some tests for `in_whitelist_check`.Gravatar Leon Sandøy2020-05-27-0/+48
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Remove the now deprecated in_channel_check.Gravatar Leon Sandøy2020-05-27-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This check was no longer being used anywhere, having been replaced by in_whitelist_check.
| | * | | | | | | | | | | | | | Merge branch 'master' into moderation_commands_in_modmail_categoryGravatar Joseph Banks2020-05-27-0/+1
| | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / / / / / | |/| | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Add /r/FlutterDev to the guild invite whitelistGravatar Dennis Pham2020-05-26-0/+1
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Allow some commands to fail checks silently.Gravatar Leon Sandøy2020-05-27-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, we don't want the mod commands to produce any kind of error message when run by ordinary users in regular channels - these should have the perception of being invisible and unavailable.
| | * | | | | | | | | | | | | | No redirect for mod management.Gravatar Leon Sandøy2020-05-27-0/+1
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Find + change all InWhitelistCheckFailure importsGravatar Leon Sandøy2020-05-27-9/+8
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Allow infraction management in modmail categoryGravatar Leon Sandøy2020-05-27-12/+13
| | | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | | Refactor the in_whitelist deco to a check.Gravatar Leon Sandøy2020-05-27-53/+86
| |/ / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're moving the actual predicate into the `utils.checks` folder, just like we're doing with most of the other decorators. This is to allow us the flexibility to use it as a pure check, not only as a decorator. This commit doesn't actually change any functionality, just moves it around.
| | * | | | | | | | | | | | | Fix ATROCIOUS comment.Gravatar Leon Sandøy2020-05-27-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I should be shot.
| | * | | | | | | | | | | | | Refactor typestring converters to partialmethods.Gravatar Leon Sandøy2020-05-27-30/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're using functools.partialmethod to make the code a little cleaner and more readable here. Read more about them here: https://docs.python.org/3/library/functools.html#functools.partial https://docs.python.org/3/library/functools.html#functools.partialmethod
| | * | | | | | | | | | | | | Floats are no longer permitted as RedisCache keys.Gravatar Leon Sandøy2020-05-27-43/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also added a test for this. This is the DRYest approach I could find. It's a little ugly, but I think it's probably good enough.