aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| * | | | | | | | | | | | | | | Token remover: fix `is_maybe_token` returning None instead of FalseGravatar MarkKoz2020-05-11-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's annotated as returning a bool and when the split fails it already returns False. To be consistent, it should always return a bool.
| * | | | | | | | | | | | | | | Test `is_maybe_token` returns False for missing partsGravatar MarkKoz2020-05-11-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, this won't ever happen since the regex wouldn't match strings with missing parts. However, the function does check it so may as well test it. It's not necessarily bound to always use inputs from the regex either I suppose.
| * | | | | | | | | | | | | | | Fix autospec decorator when used with multiple attributesGravatar MarkKoz2020-05-11-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original approach of messing with the `attribute_name` didn't work for reasons I won't discuss here (would require knowledge of patcher internals). The new approach doesn't use patch.multiple but mimics it by applying multiple patch decorators to the function. As a consequence, this can no longer be used as a context manager.
| * | | | | | | | | | | | | | | Test token regex doesn't match invalid tokensGravatar MarkKoz2020-05-11-7/+25
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Test `find_token_in_message` returns the found tokenGravatar MarkKoz2020-05-11-0/+24
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Test `find_token_in_message` returns None if no matches foundGravatar MarkKoz2020-05-11-0/+14
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Fix test for token remover ignoring bot messagesGravatar MarkKoz2020-05-11-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not possible to test this via asserting the return value of `on_message` since it never returns anything. Instead, the actual relevant unit, `find_token_in_message,` should be tested.
| * | | | | | | | | | | | | | | Allow using arbitrary parameter names with the autospec decoratorGravatar MarkKoz2020-05-11-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives the caller more flexibility. Sometimes attribute names are too long or they don't follow a naming scheme accepted by the linter.
| * | | | | | | | | | | | | | | Test token remover skips messages without tokensGravatar MarkKoz2020-05-11-0/+11
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Test token remover takes action if a token is foundGravatar MarkKoz2020-05-11-1/+13
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Add a test helper function to patch multiple attributes with autospecsGravatar MarkKoz2020-05-11-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helper reduces redundancy/boilerplate by setting default values. It also has the consequence of shortening the length of the invocation, which makes it faster to use and easier to read.
| * | | | | | | | | | | | | | | Test on_message_edit of token remover uses on_messageGravatar MarkKoz2020-05-11-2/+10
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Token remover: reduce duplicated code in `on_message_edit`Gravatar MarkKoz2020-05-11-3/+1
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Token remover: catch ValueError when non-ASCII chars are presentGravatar MarkKoz2020-05-11-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The token uses base64 and base64 only allows ASCII characters. Thus, if a match has non-ASCII characters, it's not a valid token. Catching the ValueError is simpler than trying to adjust the regex to only match valid base64. Fixes #928 Fixes BOT-3X
* | | | | | | | | | | | | | | | Merge pull request #978 from ItsDrike/unsilence-schedulerGravatar Mark2020-06-12-10/+45
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use Scheduler instead of asyncio.sleep on silence cog
| * | | | | | | | | | | | | | | | Use class instead of NamedTupleGravatar ItsDrike2020-06-06-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Using a class is more readable than using a NamedTuple
| * | | | | | | | | | | | | | | | Test for channel not silenced messageGravatar ItsDrike2020-06-06-4/+14
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Change `is` to `was` for unsilenced channel messageGravatar ItsDrike2020-06-06-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - As suggested, `was` is more fitting in the message than `is`
| * | | | | | | | | | | | | | | | Move cancel_task before notifier.remove_channelGravatar ItsDrike2020-06-06-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - as sugested notifier.remove_channel and muted_channels.discard should be together
| * | | | | | | | | | | | | | | | Do not await self.schedule_taskGravatar ItsDrike2020-06-06-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - self.schedule_task shouldn't be awaited as it isn't a coroutine
| * | | | | | | | | | | | | | | | Remove unnecessary schedule_unsilenceGravatar ItsDrike2020-06-06-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - As suggested, this function is not necessary - Also fixed no longer valid`stop`in SilencedChannel NamedTuple
| * | | | | | | | | | | | | | | | Fix import orderGravatar ItsDrike2020-06-06-1/+1
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Apply suggestions from reviewGravatar ItsDrike2020-06-06-15/+10
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Use Scheduler inside the cogGravatar ItsDrike2020-06-04-30/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - There shouldn't be another class only for Scheduler instead, we can implement it directly into Silence class
| * | | | | | | | | | | | | | | | Optimize ImportsGravatar ItsDrike2020-06-01-4/+4
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Fix Formatting/StylingGravatar ItsDrike2020-06-01-8/+5
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Use Scheduler instead of asyncio.sleep on silence cogGravatar ItsDrike2020-06-01-10/+56
| | |_|/ / / / / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `asyncio.sleep` doesn't provide us with the ability to stop that timer, while in most of the cases, this is fine, there is a possibility that channel will be unsilenced manually and silenced again, but this sleep from the first silence will cancel the second (new) silence. This will replace this `asyncio.sleep` with Scheduler which provides the ability to cancel the unsilencing task when aborted manually. That means we also have the ability to send a response if the channel is not silenced and someone tries to unsilence it.
* | | | | | | | | | | | | | | | Merge pull request #997 from python-discord/bug/frontend/996/charinfo-md-escapeGravatar Joseph Banks2020-06-13-2/+2
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | Escape markdown in charinfo embed
| * | | | | | | | | | | | | | | Escape markdown in charinfo embedGravatar MarkKoz2020-06-12-2/+2
|/ / / / / / / / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The embed displays the original character. If it's a markdown char, it would interfere with the embed's actual markdown. The backtick was especially troublesome. Fixes #996
* | | | | | | | | | | | | | | Replace mention of Flask with DjangoGravatar Mark2020-06-11-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The site's description still stated that it was built with Flask, which is no longer accurate due to the move to Django.
* | | | | | | | | | | | | | | Merge pull request #964 from ks129/bad-words-nickGravatar Joseph Banks2020-06-11-21/+61
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Filtering: Implement bad words detection in nicknames
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bad-words-nickGravatar Joseph Banks2020-06-11-1/+35
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Merge pull request #995 from python-discord/add-cooldown-channelGravatar Mark2020-06-11-1/+3
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add cooldown channel to config-default.yml
| * | | | | | | | | | | | | | | | Add cooldown to Channels in constants.pyGravatar Joseph Banks2020-06-11-0/+1
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Add cooldown channel to EXCLUDED_CHANNELS tupleGravatar Joseph Banks2020-06-11-1/+1
| | | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | | Add cooldown channel to config-default.ymlGravatar Joseph Banks2020-06-11-0/+1
|/ / / / / / / / / / / / / / / /
* | | | | | | | | | | | | | | | Fix trailing whitespace in Action fileGravatar Joseph Banks2020-06-11-1/+1
| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Create codeql-analysis.ymlGravatar Joseph Banks2020-06-11-0/+32
| | | | | | | | | | | | | | | |
| * | | | | | | | | | | | | | | Merge branch 'master' into bad-words-nickGravatar ks1292020-06-11-239/+552
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | Merge pull request #910 from python-discord/bug/backend/906/converter-year-rangeGravatar Joseph Banks2020-06-10-52/+66
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converters: handle ValueError when year for duration is out of range
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bug/backend/906/converter-year-rangeGravatar Joseph Banks2020-06-10-1194/+2938
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | Merge pull request #988 from python-discord/snekbox-composeGravatar Joseph Banks2020-06-10-0/+9
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add snekbox to the Docker compose file
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into snekbox-composeGravatar Joseph Banks2020-06-10-2/+14
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | Merge pull request #935 from python-discord/bug/mod/932/modlog-ignore-dmsGravatar Joseph Banks2020-06-10-0/+4
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ModLog: ignore DMs in the message delete listener
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into bug/mod/932/modlog-ignore-dmsGravatar Joseph Banks2020-06-10-1061/+2576
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | Add Python Atlanta to guild whitelistsGravatar Joseph Banks2020-06-09-0/+1
| | | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | Merge pull request #983 from python-discord/bug/backend/stats-category-checkGravatar Dennis Pham2020-06-07-1/+2
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | | | | Fix AttributeError for category check
| * | | | | | | | | | | | | | | | | | Merge branch 'master' into bug/backend/stats-category-checkGravatar Dennis Pham2020-06-07-33/+96
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / / / / / / / / / |/| | | | | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | | | | | Enable the 'redis' / 'aiohttp' Sentry integrationsGravatar Leon Sandøy2020-06-06-1/+7
| |_|_|_|_|_|_|_|/ / / / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will provide breadcrumbs for these systems in all our Sentry events, if applicable. Closes #989.
| * | | | | | | | | | | | | | | | | Fix AttributeError for category checkGravatar MarkKoz2020-06-04-1/+2
| | |_|_|_|_|_|/ / / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all channels will have a category attribute. This may be fine in production, but it does cause periodic errors when testing locally.