aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2020-07-31Remove superfluous Available help channels.Gravatar Leon Sandøy-4/+12
This adds a little bit of logic to the Help Channel `init_available` coroutine, which runs when the cog loads. This ensures that if there are more help channels in available than there should be, we remove the superfluos ones. Previously, if the bot started with too many channels, it would maintain and defend that excessive amount. This is because we never actually count the number of channels before adding in new available channels whenever one disappears. If we ever get too many available channels in the future, this can be solved by simply reloading this cog.
2020-07-30Use full flag name for case-insensitivityGravatar Senjan21-1/+1
requested by lemon
2020-07-30Missed `?` in regex.Gravatar Senjan21-1/+1
2020-07-30Use non-capturing group instead.Gravatar Senjan21-1/+1
2020-07-30Change regex so it catches new discord URLGravatar Senjan21-1/+1
2020-07-30Fix channel moving incase `message.pin` failsGravatar Senjan21-0/+2
2020-07-29Don't ping everyone when tripping filter in DMs.Gravatar Leon Sandøy-1/+1
We don't need a ping in #mod-alerts whenever someone is tripping a filter (like invites or bad language) in a DM to the bot. We can still send an embed, so that we can action it, but there is no urgent need to respond if it's just a direct message to the bot. This is particularly true now that we have #dm-log.
2020-07-28Handle message unpinning betterGravatar ks129-2/+5
2020-07-28correct import orderGravatar Senjan21-1/+1
2020-07-28fix poll command by using clean_content converterGravatar Senjan21-2/+2
2020-07-28Allow specifying a channel to send !embed embedsGravatar kosayoda-3/+7
2020-07-27Update IDs of Code Jam rolesGravatar Sebastiaan Zeeff-2/+2
I've updated the IDs of the two Code Jam Roles to the newly create roles we have.
2020-07-24Fix: Implicit string concatenation considered harmfulGravatar kosayoda-4/+1
Python joins two string adjacent string literals implicitly, which may cause unintended side effects when used with certain string methods. >>> 'A' ' '.join(['1', '2', '3']) '1A 2A 3'
2020-07-23Disabled burst_shared filter temporarilyGravatar Joe Banks-4/+0
2020-07-22Charinfo: correct char limit used in error messageGravatar Mark-1/+1
Co-authored-by: Kieran Siek <[email protected]>
2020-07-23Check that embed desc is not Empty before stripping.Gravatar kosayoda-2/+5
2020-07-22Charinfo: up char limit and reduce line limitGravatar MarkKoz-4/+4
Pagination means more characters can be supported without cluttering anything. It also means infinite lines, so there's no longer a need to squeeze out the most from a single page. Reducing the line limit leads to a smaller, tidier presentation.
2020-07-22Charinfo: use more descriptive field name Gravatar Mark-1/+1
Since the raw field is displayed on every page, but pages are incomplete, it may be unclear whether the field's value is for the current page or for all pages. Co-authored-by: Kieran Siek <[email protected]>
2020-07-22Jam tests: use the MAX_CHANNELS constant moreGravatar MarkKoz-4/+4
It's clearer to write MAX_CHANNELS - 2 than a literal 48.
2020-07-22Jam tests: assert equality of new categoryGravatar MarkKoz-1/+2
2020-07-22Jam tests: add subtests to non-existent category testGravatar MarkKoz-7/+18
The test has to account for not only the name not matching, but also a lack of available spaces for new channels.
2020-07-22Jam tests: fix category testGravatar MarkKoz-14/+24
2020-07-22Jams: create a new category if others are fullGravatar MarkKoz-20/+31
2020-07-22Jam Tests: space out lines for readabilityGravatar MarkKoz-0/+6
2020-07-22Jam Tests: remove default_args attributeGravatar MarkKoz-4/+3
Kind of redundant since it's only used by two tests.
2020-07-22Jam Tests: re-arrange tests to follow definition order in the cogGravatar MarkKoz-10/+10
2020-07-22Jam Tests: fix utils patchGravatar MarkKoz-4/+5
stop needs to be called on the patcher, not the mock. Furthermore, using addCleanup is safer than tearDown because the latter may not be called if an exception is raised in setUp.
2020-07-21Charinfo: paginate the resultsGravatar MarkKoz-6/+6
Pagination ensures the results will never go over the char limit for an embed. Fixes #897 Fixes BOT-3D
2020-07-21Charinfo: use send_denial helperGravatar MarkKoz-13/+7
2020-07-21Fix test for token remover log messageGravatar MarkKoz-2/+1
2020-07-21Use user mentions in infraction search resultsGravatar MarkKoz-14/+21
Using our expanded API is more efficient than making a request to the Discord API for potentially every user in the search results. The data may not be up to date, but that's an acceptable compromise.
2020-07-21ModLog: use user mentionsGravatar MarkKoz-22/+12
2020-07-21Filtering: use user mentions in mod logsGravatar MarkKoz-6/+5
2020-07-21Filtering: refactor _add_stats to return a NamedTupleGravatar MarkKoz-25/+27
2020-07-21Filtering: refactor sending of mod logGravatar MarkKoz-59/+47
A lot of redundant code existed between the message and eval filters.
2020-07-21Use user mentions in mod logsGravatar MarkKoz-10/+14
2020-07-21Moderation: use user mentions in mod logsGravatar MarkKoz-18/+14
2020-07-21Moderation: remove multiple active infractions checkGravatar MarkKoz-36/+0
The API was change a long time ago to not allow such a situation.
2020-07-21Superstarify: escape Markdown in nicknamesGravatar MarkKoz-1/+4
2020-07-21Superstarify: use user mentions in mod logsGravatar MarkKoz-3/+4
`format_user` isn't used in the apply mod log cause it already shows both the old and new nicknames elsewhere.
2020-07-21Add util function to format user namesGravatar MarkKoz-0/+7
This will be used a lot when sending mod logs and will help with reducing redundancy and maintaining consistency.
2020-07-21Clean up importsGravatar MarkKoz-14/+13
2020-07-21Use max_units for time since join in user command instead of precisionGravatar Joe Banks-1/+1
2020-07-20Edited tests to reflect changes (removed py formatting)Gravatar wookie184-3/+3
2020-07-20Removed python formatting from returned codeblockGravatar wookie184-1/+1
2020-07-19Revert "Remove duplicate reminder deletion."Gravatar kosayoda-1/+1
This reverts commit 776b4379c478284803a4a526b5f14fe63d8e7c01. This is already being fixed in #835, and therefore is no longer required.
2020-07-19Remove duplicate mentions from reminder argumentsGravatar kosayoda-2/+10
This also accounts for the author passing themselves to mention, and therefore avoids the user from being told they're not allowed to mention themselves even though they could.
2020-07-19Refactor commands return typeGravatar kosayoda-5/+8
2020-07-19Move mentions validation to another methodGravatar kosayoda-13/+20
2020-07-19Refactor reminder edits to reduce code duplicationGravatar kosayoda-40/+25
The reminder expiration returnedfrom the API call is also now parsed again even when the edit is to the duration since it does not matter and trying to keep it DRY while still doing that check is a pain.