aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | | * | | | | | (Moderation Utils Tests): Hard-coded API get request params for ↵Gravatar ks1232020-03-08-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `has_active_infraction` test.
| | | * | | | | | (Moderation Utils Tests): Removed large `utils` parts import, use import ↵Gravatar ks1232020-03-08-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `utils` instead and added `utils` before variables and function that was imported directly before.
| | | * | | | | | (Moderation Utils Tests): Fixed docstrings, added more information to these.Gravatar ks1232020-03-08-6/+8
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Fixed errors, added checks before assertions for ↵Gravatar ks1232020-03-05-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | errors
| | | * | | | | | (Moderation Utils Tests): Added additional assertions to `post_infraction` test.Gravatar ks1232020-03-05-8/+54
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Added `user.send` call assertion to ↵Gravatar ks1232020-03-05-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `test_send_private_embed`.
| | | * | | | | | (Moderation Utils Tests): Added API POST call assertion to `test_post_user`.Gravatar ks1232020-03-05-5/+24
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Added new assertions to `notify_pardon`, added ↵Gravatar ks1232020-03-05-6/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ctx.send` raising errors, added check for return values and `send_private_embed` call.
| | | * | | | | | (Moderation Utils Tests): Added new assertions to `post_infraction`, added ↵Gravatar ks1232020-03-05-11/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ctx.send` raising errors, added check for return values and `send_private_embed` call.
| | | * | | | | | (Moderation Utils Tests): Added following new assertions to ↵Gravatar ks1232020-03-05-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `has_active_infraction` tests: `ctx.send` and `bot.api_client.get` calling.
| | | * | | | | | (Moderation Utils Tests): Use `bot.cogs.moderation.utils`'s `RULES_URL` ↵Gravatar ks1232020-03-05-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead creating new one
| | | * | | | | | (Moderation Utils Tests): Removed unnecessary `AsyncMock()` from `__init__` ↵Gravatar ks1232020-03-05-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (`self.bot.api_client.get`)
| | | * | | | | | (Moderation Utils Tests): Moved `has_active_infraction` tests to one test.Gravatar ks1232020-03-05-22/+35
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): `send_private_embed` moved exception creating from ↵Gravatar ks1232020-03-05-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cases testing to test cases listing, added side_effect resetting.
| | | * | | | | | (Moderation Utils Tests): Created tests for `post_infraction` function, ↵Gravatar ks1232020-03-05-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | created __init__.py for moderation tests
| | | * | | | | | (Moderation Utils Tests): Created tests for `send_private_embed` function + ↵Gravatar ks1232020-03-04-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed errors.
| | | * | | | | | (Moderation Utils Tests): Created tests for `post_user` function.Gravatar ks1232020-03-04-1/+59
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Created tests for `notify_pardon` function.Gravatar ks1232020-03-04-2/+39
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Created tests for `notify_infraction` function.Gravatar ks1232020-03-04-2/+91
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Created tests for `has_active_infraction` functionGravatar ks1232020-03-03-0/+24
| | | | | | | | |
| | | * | | | | | (Moderation Utils Tests): Added imports, modified tests class instance and ↵Gravatar ks1232020-03-03-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | created new params for tests class
| | | * | | | | | Created file for moderation utils tests + added setUp to this.Gravatar ks1232020-03-03-0/+12
| | | | | | | | |
| | | | | | * | | Fix cog_check testsGravatar MarkKoz2020-09-08-8/+12
| | | | | | | | |
| | | | | | * | | Fix tests for has_any_role_checkGravatar MarkKoz2020-09-08-16/+18
| | | | | | | | |
| | | | | | * | | Rename role checks and decoratorsGravatar MarkKoz2020-09-08-33/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make their names more in line with `has_any_role` for consistency.
| | | | | | * | | Implement role checks using has_any_roleGravatar MarkKoz2020-09-07-34/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `has_any_role` to reduce redundancy. Because discord.py always makes a check's predicate a coroutine, the checks now have to be awaited.
| | | | | | * | | Use has_any_role's predicate directlyGravatar MarkKoz2020-09-06-31/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some places, it's more appropriate than using with_role_check since it will raise CheckFailures. This applies to `cog_check`s and other things which effectively act as command checks.
| | | | | | * | | Implement the without_role decorator by negating has_any_roleGravatar MarkKoz2020-09-06-6/+17
| | | | | | | | |
| | | | | | * | | Remove with_role decorator in favour of has_any_roleGravatar MarkKoz2020-09-05-76/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `with_role` is obsolete because discord.py provides `has_any_role`.
| | | | | | | | * Lower duckpond threshold to increase activityGravatar Sebastiaan Zeeff2020-09-20-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's not a lot of activity in our duckpond at the moment. To activate our duckies, I've decreased the duckpond threshold to 4. This means that a message will now be relayed once it's been ducked four times. Let's get all of our ducks in a row. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Add command to relay a message to duckpondGravatar Sebastiaan Zeeff2020-09-20-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a command that allows admins to manually relay a message to the duckpond, regardless of duck counts and the checks done in the reaction event handler. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Use helper for duckpond's locked relay featureGravatar Sebastiaan Zeeff2020-09-20-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've created a helper for duckpond's relay feature to allow me to use it separately from the command we're planning to add to the Cog. I opted not to include the lock in the original relay method to separate the logic more clearly. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Remove unit tests for duck pondGravatar Sebastiaan Zeeff2020-09-20-548/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've removed the unit tests for duckpond in concordance with the new policy for writing unit tests for the bot The tests were unnecessarily complicated, difficult to maintain, and slowed development. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Fix relay race condition in duckpond using a lockGravatar Sebastiaan Zeeff2020-09-20-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our duckpond suffered from a race condition: If multiple raw reaction events were received in quick succession and a message had enough ducks to take it over the duckpond threshold, the message would be relayed multiple times. The reason this happened is because the green checkmark emoji that stops a message from being relayed multiple times is only added after the message has been relayed. This means that multiple event triggers can make it past the green checkmark check before any of them has a chance to add a green checkmark. The solution was to create a relay lock that needs to be acquired before checking for the presence of a green checkmark and is only released after adding a green checkmark. This prevents multiple events from making it past the sentinel check. As our Cogs are potentially initialized before the event loop is created, the lock is load lazily when needed. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Add channel blacklist for duckpondGravatar Sebastiaan Zeeff2020-09-20-4/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As announcements already get a lot of exposure and have a high risk of getting "ducked", duckpond will now ignore those channels and never relay those announcements to our duckpond. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Ignore non-staff messages for our duckpondGravatar Sebastiaan Zeeff2020-09-20-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some of our members have expressed concern that their messages would be "ducked" by staff members and relayed to the staff-only duckpond. Since duckpond is supposed to be a funny, staff-only affair, I've made duckpond ignore messages from non-staff members. Signed-off-by: Sebastiaan Zeeff <[email protected]>
| | | | | | | | * Determine eligible duckpond emojis dynamicallyGravatar Sebastiaan Zeeff2020-09-20-70/+27
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of maintaining a list of duckpond IDs manually, it's a much better idea to detect ducky emojis dynamically using the new emoji name grouping we've introduced: All emojis that start with `ducky_` will now be counted as a duckpond ducky. The unicode duck emoji obviously still counts in addition to custom emojis with the `ducky_` prefix. Signed-off-by: Sebastiaan Zeeff <[email protected]>
* | | | | | | | Use global namespace `bot` for our RedisSessionGravatar Sebastiaan Zeeff2020-09-19-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we're now planning on using Redis in multiple applications, it's important to minimize the risk of namespace collisions between different applications. The `async-rediscache` packages allows us to set a global namespace on an application level. I've chosen "bot" as the namespace for this application, which means all individual namespaces will automatically be prefixed by `bot.` whenever they are accessed. Signed-off-by: Sebastiaan Zeeff <[email protected]>
* | | | | | | | Remove vestigial RedisCache class definitionGravatar Sebastiaan Zeeff2020-09-19-681/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we're now using the `async-rediscache` package, it's no longer necessary to keep the `RedisCache` defined in `bot.utils.redis_cache` around. I've removed the file containing it and the tests written for it. Signed-off-by: Sebastiaan Zeeff <[email protected]>
* | | | | | | | Use async-rediscache package for our redis cachesGravatar Sebastiaan Zeeff2020-09-19-163/+167
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've migrated our redis caches over to the async-rediscache package that we've recently released (https://git.pydis.com/async-rediscache). The main functionality remains the same, although the package handles some things, like getting the active session, differently internally. The main changes you'll note for our bot are: - We create a RedisSession instance and ensure that it connects before we even create a Bot instance in `__main__.py`. - We are now actually using a connection pool instead of a single connection. - Our Bot subclass now has a new required kwarg: `redis_session`. - Bool values are now properly converted to and from typestrings. In addition, I've made sure that our MockBot passes a MagicMock for the new `redis_session` kwarg when creating a Bot instance for the spec_set. Signed-off-by: Sebastiaan Zeeff <[email protected]>
* | | | | | | Merge pull request #1158 from python-discord/config-updateGravatar Senjan212020-09-16-3/+4
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Updated the names of reddit emotes
| * | | | | | | remove random space in `upvotes` valueGravatar Senjan212020-09-16-1/+1
| | | | | | | |
| * | | | | | | update the reddit emojis to actual emojis'Gravatar Senjan212020-09-16-3/+3
| | | | | | | |
| * | | | | | | Updating names of reddit emotes.Gravatar Senjan212020-09-16-3/+4
| | | | | | | |
* | | | | | | | Merge pull request #927 from Numerlor/truncate-internal-evalGravatar Kieran Siek2020-09-16-62/+186
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Truncate internal eval.
| * | | | | | | Merge branch 'master' into truncate-internal-evalGravatar Kieran Siek2020-09-16-1923/+4960
| |\ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | |
* | | | | | | | Verification: update & improve docstringsGravatar kwzrd2020-09-11-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After moving constants to config, the docstring references were not updated accordingly, and remained uppercase. This commit also removed the redundant list indentation.
* | | | | | | | Merge pull request #1077 from python-discord/kwzrd/verificationGravatar Daniel Brown2020-09-10-21/+617
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / |/| | | | | | | Take steps to increase verification rate
| * | | | | | | Merge branch 'master' into kwzrd/verificationGravatar Daniel Brown2020-09-10-800/+529
| |\ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | |
* | | | | | | | Merge pull request #1144 from Numerlor/text-link-fixGravatar Shirayuki Nekomata2020-09-05-2/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Move bolding markdown outside of text link in help channel messages.