aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Silence tests: add a test for the time cacheGravatar MarkKoz2020-08-17-0/+15
|
* Silence tests: fix mock for _init_taskGravatar MarkKoz2020-08-17-2/+4
| | | | | | | An `AsyncMock` fails because it returns a coroutine which may only be awaited once. However, an `asyncio.Future` is perfect because it is easy to create and can be awaited repeatedly, just like the actual `asyncio.Task` that is being mocked.
* Silence tests: create channel and overwrite in setUp for silence testsGravatar MarkKoz2020-08-17-29/+17
| | | | Reduce code redundancy by only defining them once.
* Silence tests: merge unsilence fixture into setUpGravatar MarkKoz2020-08-17-32/+20
| | | | | Now that there are separate test cases, there's no need to keep the fixtures separate.
* Silence tests: autospec _reschedule and SilenceNotifier for cog testsGravatar MarkKoz2020-08-17-4/+10
|
* Silence tests: separate test cases; refactor names & docstringsGravatar MarkKoz2020-08-17-71/+95
|
* Silence tests: fix tests for _unsilenceGravatar MarkKoz2020-08-17-30/+45
| | | | | Add a fixture to set up mocks for a successful `unsilence` call. This reduces code redundancy.
* Silence tests: fix test_unsilence_private_removed_notifierGravatar MarkKoz2020-08-17-2/+5
|
* Silence tests: fix overwrite preservation test for silencesGravatar MarkKoz2020-08-17-11/+15
|
* Silence tests: fix command message testsGravatar MarkKoz2020-08-17-15/+10
|
* Silence tests: fix test_silence_private_for_falseGravatar MarkKoz2020-08-17-4/+13
|
* Silence tests: fix test_silence_private_silenced_channelGravatar MarkKoz2020-08-17-3/+10
|
* Silence tests: fix test_silence_private_notifierGravatar MarkKoz2020-08-17-0/+3
|
* Silence tests: fix test_unsilence_private_for_falseGravatar MarkKoz2020-08-17-1/+4
|
* Silence tests: fix silence cache test for overwritesGravatar MarkKoz2020-08-17-5/+8
|
* Silence tests: replace obsolete cog_unload testsGravatar MarkKoz2020-08-17-13/+4
| | | | | Moderation notifications are no longer sent so that doesn't need to be tested.
* Silence tests: rename test_instance_vars to test_init_cogGravatar MarkKoz2020-08-17-5/+5
|
* Silence tests: mock RedisCachesGravatar MarkKoz2020-08-17-3/+2
|
* Tests: optionally prevent autospec helper from passing mocksGravatar MarkKoz2020-08-17-19/+66
| | | | | | | | | Not everything that's decorated needs the mocks that are patched. Being required to add the args to the test function anyway is annoying. It's especially bad if trying to decorate an entire test suite, as every test would need the args. Move the definition to a separate module to keep things cleaner.
* Silence: rename _get_instance_vars to _init_cogGravatar MarkKoz2020-08-16-9/+9
| | | | It's a more accurate name since it also reschedules unsilences now.
* Silence: remove event and await _get_instance_vars_task directlyGravatar MarkKoz2020-08-16-6/+2
| | | | | | The event is redundant because the task can be awaited directly to block until it's complete. If the task is already done, the await will instantly finish.
* Silence: use aware datetimesGravatar MarkKoz2020-08-16-5/+6
| | | | | | | | `datetime.timestamp()` assumes naïve `datetime`s are in local time, so getting POSIX timestamps in UTC isn't easy for naïve ones. Technically, the timestamp's timezone doesn't matter if all code is on the same page and parsing it with the same timezone. Keeping it in the local timezone would be okay then, but I feel safer locking it to UTC explicitly.
* Silence: reschedule silences on startupGravatar MarkKoz2020-08-16-10/+32
| | | | | | | | | | | | Remove the moderator notification when unloading the cog because. Its purpose was to remind to manually unsilence channels. However, this purpose is now obsolete due to automatic rescheduling. The notification was buggy anyway due to a race condition with the bot shutting down, and that'd be further complicated by having to asynchronously retrieve channels from the redis cache too. Fixes #1053
* Silence: persist silenced channelsGravatar MarkKoz2020-08-16-0/+11
| | | | Can be used to support rescheduling.
* Silence: add separate unsilence error for manually-silenced channelsGravatar MarkKoz2020-08-15-1/+9
| | | | | | | It was confusing to reject a silence and an unsilence when overwrites were manually set to False. That's because it's contradictory to show an error stating it's already silence but then reject an unsilence with an error stating the channel isn't silenced.
* Silence: notify admins if previous overwrites were not cachedGravatar MarkKoz2020-08-15-12/+25
| | | | | Admins will have to manually check the default values used and adjust them if they aren't the desired values for that particular channel.
* Silence: abort silence if there's already a scheduled taskGravatar MarkKoz2020-08-15-1/+1
| | | | | | Overwrites can be edited during a silence, which can result in the overwrites check failing. Checking the scheduler too ensures that a duplicate silence won't be scheduled.
* Silence: revoke permissions to add reactionsGravatar MarkKoz2020-08-15-11/+27
| | | | | | | | | | No longer assume default values for the overwrites which are modified. Save and restore previous values `add_reactions` and `send_messages` via redis. When unsilencing, check if a channel is silenced via the redis cache rather than the channel's current overwrites to ensure the task is cancelled even if overwrites were manually edited.
* Merge pull request #1102 from AtieP/patch-1Gravatar kwzrd2020-08-13-1/+1
|\ | | | | Fix typo on the traceback tag
| * Fix typo on the traceback tagGravatar AtieP2020-08-13-1/+1
|/ | | See issue #1101
* Merge pull request #1097 from Numerlor/remove-api-endpointsGravatar Dennis Pham2020-08-11-33/+4
|\ | | | | Remove api endpoint config values.
| * Merge branch 'master' into remove-api-endpointsGravatar Dennis Pham2020-08-11-0/+3
| |\ | |/ |/|
* | Create kindling-projects tagGravatar Dennis Pham2020-08-09-0/+3
| |
| * Reorder site URL constants.Gravatar Numerlor2020-08-10-2/+4
| |
| * Remove unused api endpoint config constants.Gravatar Numerlor2020-08-10-31/+0
|/ | | | | The constants aren't used anywhere in the bot, and are incompatible with the APIClient.
* Merge pull request #1084 from ↵Gravatar Mark2020-08-09-1/+4
|\ | | | | | | | | python-discord/bug/filters/1027/ignore-webhook-names Ignore webhooks for nickname filter
| * Merge branch 'master' into bug/filters/1027/ignore-webhook-namesGravatar Dennis Pham2020-08-09-136/+155
| |\ | |/ |/|
* | Merge pull request #1085 from python-discord/bug/util/1079/long-poll-titlesGravatar Dennis Pham2020-08-09-0/+2
|\ \ | | | | | | Utils: show error message for long poll titles
| * \ Merge branch 'master' into bug/util/1079/long-poll-titlesGravatar Dennis Pham2020-08-09-136/+153
| |\ \ | |/ / |/| |
* | | Remove unnecessary edits during paginationGravatar Joe Banks2020-08-08-10/+0
| | |
* | | Merge pull request #1086 from python-discord/bug/help/1082/unpin-id-noneGravatar Dennis Pham2020-08-07-27/+64
|\ \ \ | | | | | | | | Help channel message pin fixes
| * \ \ HelpChannels: fix conflict in move_to_dormantGravatar MarkKoz2020-08-07-100/+90
| |\ \ \ | |/ / / |/| | |
* | | | Merge pull request #1092 from python-discord/bug/help/1074/duplicate-claimGravatar scragly2020-08-07-3/+1
|\ \ \ \
| * \ \ \ Merge branch 'master' into bug/help/1074/duplicate-claimGravatar scragly2020-08-07-98/+90
| |\ \ \ \ | |/ / / / |/| | | |
* | | | | Merge pull request #1093 from python-discord/discord.py-1.4Gravatar kwzrd2020-08-06-79/+51
|\ \ \ \ \ | | | | | | | | | | | | Deps: update discord.py to 1.4.0
| * | | | | Deps: update discord.py to 1.4.0Gravatar MarkKoz2020-08-06-79/+51
|/ / / / / | | | | | | | | | | | | | | | It was released on PyPI. No longer need to clone via git.
* | | | | Guild invite regex: Add support for dashes in the invite codeGravatar Dennis Pham2020-08-05-1/+1
| | | | |
* | | | | Merge pull request #1087 from ↵Gravatar Dennis Pham2020-08-05-1/+14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | python-discord/bug/backend/1080/cog-reload-cancel-scheduler Cancel scheduled tasks when cogs unload
| * \ \ \ \ Merge branch 'master' into bug/backend/1080/cog-reload-cancel-schedulerGravatar Dennis Pham2020-08-05-16/+23
| |\ \ \ \ \ | |/ / / / / |/| | | | |
* | | | | | Merge pull request #1091 from python-discord/kwzrd/fix-1090Gravatar Dennis Pham2020-08-05-9/+8
|\ \ \ \ \ \ | | | | | | | | | | | | | | RedisCache: remove erroneous `_redis` alias