aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | * | | | | | | | | | | | | | | | | | | | | | | | Verification: add initial on join messageGravatar kwzrd2020-08-02-0/+7
| | | |_|_|_|_|_|_|/ / / / / / / / / / / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This message will be sent via direct message to each user who joins the guild.
| | | | | * | | | | | | | | | | | | | | | | | | | Change tests to work with the new file layout.Gravatar Numerlor2020-07-15-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 326beebe9b097731a39ecc9868e5e1f2bd762aae
| | | | | * | | | | | | | | | | | | | | | | | | | Move `find_nth_occurrence` to utils helpersGravatar Numerlor2020-07-15-13/+14
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | Move `send_to_paste_service` to services submoduleGravatar Numerlor2020-07-15-54/+55
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | Move general helper functions to submodule.Gravatar Numerlor2020-07-15-15/+14
| | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | Merge branch 'master' into truncate-internal-evalGravatar Numerlor2020-06-21-492/+1374
| | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # Conflicts: # bot/utils/__init__.py
| | | | | * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'master' into truncate-internal-evalGravatar Numerlor2020-05-30-963/+2140
| | | | | |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \
| | | | | * | | | | | | | | | | | | | | | | | | | | | Strip empty lines from int eval output.Gravatar Numerlor2020-05-30-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output generates trailing newlines, which can cause the output to be uploaded to the paste service in cases where it's not needed, as discord will automatically remove those in messages.
| | | | | * | | | | | | | | | | | | | | | | | | | | | Truncate amount of lines in int eval output to 15.Gravatar Numerlor2020-05-30-2/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the amount of newlines was checked and uploaded to the paste service if above 15 but the sent message was not truncated to only include that amount of lines.
| | | | | * | | | | | | | | | | | | | | | | | | | | | Add tests for `send_to_paste_service`.Gravatar Numerlor2020-05-08-0/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Adjust behaviour for new func usage.Gravatar Numerlor2020-05-07-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Remove tests from moved function.Gravatar Numerlor2020-05-07-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Log unexpected JSON responses.Gravatar Numerlor2020-05-07-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | continue on internal server errors.Gravatar Numerlor2020-05-07-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case we receive `"message"` in the json response, the server had an internal error and we can attempt the request again.
| | | | | * | | | | | | | | | | | | | | | | | | | | | Handle broad exceptions.Gravatar Numerlor2020-05-07-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case an unexpected exception happens, this allows us to try the request again or let the function exit gracefully in the case of multiple fails.
| | | | | * | | | | | | | | | | | | | | | | | | | | | Continue on failed connections.Gravatar Numerlor2020-05-07-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not using skipping the iteration but continuing directly caused `response_json` being checked but not defined in case of connection errors. Co-authored-by: MarkKoz <[email protected]>
| | | | | * | | | | | | | | | | | | | | | | | | | | | Use new util function for uploading output.Gravatar Numerlor2020-05-06-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Handle failed paste uploads.Gravatar Numerlor2020-05-06-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Increase log level.Gravatar Numerlor2020-05-06-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Send long eval output to paste service.Gravatar Numerlor2020-05-06-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Attempt requests multiple times with connection errors.Gravatar Numerlor2020-05-05-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | * | | | | | | | | | | | | | | | | | | | | | Create utility function for uploading to paste service.Gravatar Numerlor2020-05-05-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: fix scheduled tasks not being cancelled on unloadGravatar MarkKoz2020-10-09-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: make _async_init attribute tests more robustGravatar MarkKoz2020-10-08-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: remove _mod_log_channel attributeGravatar MarkKoz2020-10-08-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's only used as an argument to `SilenceNotifier`, so it doesn't need to be an instance attribute.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: add to notifier when indefinite rather than temporaryGravatar MarkKoz2020-10-08-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accidentally swapped the logic in a previous commit during a refactor.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: fix unawaited coro warningsGravatar MarkKoz2020-10-07-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because the Scheduler is mocked, it doesn't actually do anything with the coroutines passed to the schedule() functions, hence the warnings.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: rename _init_cog to _async_initGravatar MarkKoz2020-10-06-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: refactor _silenceGravatar MarkKoz2020-10-06-33/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename to `_silence_overwrites` * Reduce responsibilities to only setting permission overwrites * Log in `silence` instead * Add to notifier in `silence` instead
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: move unsilence scheduling to a separate functionGravatar MarkKoz2020-10-06-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Add license & copyright for autospec's _decoration_helperGravatar MarkKoz2020-09-25-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: use f-string for messageGravatar Mark2020-09-22-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: Numerlor <[email protected]>
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: cancel init task when cog unloadsGravatar MarkKoz2020-08-18-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence: rename cachesGravatar MarkKoz2020-08-18-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: remove unnecessary spec_set argsGravatar MarkKoz2020-08-18-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not really necessary to set to True when mocking functions.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: more accurately assert the silence cmd schedule a taskGravatar MarkKoz2020-08-18-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a test for rescheduling active silencesGravatar MarkKoz2020-08-18-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: test the rescheduler unsilences expired silencesGravatar MarkKoz2020-08-18-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: test the rescheduler adds permanent silence to notifierGravatar MarkKoz2020-08-18-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: test the scheduler skips missing channelsGravatar MarkKoz2020-08-18-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a test for _init_cog rescheduling unsilencesGravatar MarkKoz2020-08-18-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: remove _reschedule patch for cog testsGravatar MarkKoz2020-08-18-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | They don't do anything because they patch the class rather than the instance. It's too late for patching the instance to work since the `setUp` fixture, which instantiates the cog, executes before the patches do. Patching `setUp` would work (and its done in the other test cases), but some tests in this case will need the unpatched function too. Patching it doesn't serve much benefit to most tests anyway, so it's not worth the effort trying to make them work where they aren't needed.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: access everything via the silence moduleGravatar MarkKoz2020-08-18-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The module is imported anyway to keep imports short and clean. Using it in patch targets is shorter and allows for the two imports from the module to be removed.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a subtest for the manual unsilence messageGravatar MarkKoz2020-08-17-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: assert against message constantsGravatar MarkKoz2020-08-17-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Duplicating strings in assertions is redundant, closely coupled, and less maintainable.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: also test that cache misses preserve other overwritesGravatar MarkKoz2020-08-17-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a test for a mod alert on cache missGravatar MarkKoz2020-08-17-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a test for default overwrites on cache missGravatar MarkKoz2020-08-17-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use a False for `add_reactions` in the mock overwrite rather than None to be sure the default (also None) is actually set for it. Fix channels set by `_init_cog` not being mocked properly.
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a test for task cancellationGravatar MarkKoz2020-08-17-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | * | | | | | | | | | Silence tests: add a test for deletion from the time cacheGravatar MarkKoz2020-08-17-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | |