aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py (unfollow)
Commit message (Collapse)AuthorLines
2021-05-04Copy Existing Text Channel Cache Tests For VoiceGravatar Hassan Abouelela-82/+97
Duplicates existing silence and unsilence cache tests for voice channels. Signed-off-by: Hassan Abouelela <[email protected]>
2021-04-24Uses Async Asserts Where PossibleGravatar Hassan Abouelela-21/+21
Signed-off-by: Hassan Abouelela <[email protected]>
2021-04-21Removes Unnecessary Members In Silence TestsGravatar Hassan Abouelela-16/+14
Reduces the number of members created for each test to the bare minimum required. Signed-off-by: Hassan Abouelela <[email protected]>
2021-04-20Add the Moderators role to moderation_roles in configGravatar Joe Banks-0/+1
This allows mod alert pings to go through in #mod-alerts, the allowed mentions only included the mods team role which is not pinged on mod alerts.
2021-04-20Remove allowed mentions in modlog alertGravatar Boris Muratov-2/+1
The modlog alert embed no longer pings everyone.
2021-04-20Improve rediscache docGravatar Boris Muratov-1/+1
Co-authored-by: ChrisJL <[email protected]>
2021-04-20Tests: AsyncMock is now in the standard library!Gravatar Matteo Bertucci-1/+1
The `tests/README.md` file still referenced our old custom `AsyncMock` that has been removed in favour of the standard library one that has been introduced in 3.8. This commit fixes this by updating the section.
2021-04-19Update bot/exts/moderation/infraction/superstarify.pyGravatar Vivaan Verma-1/+1
Co-authored-by: Boris Muratov <[email protected]>
2021-04-19Change type hint from duration to expiryGravatar Vivaan Verma-2/+2
2021-04-19Add default duration as constant and use Duration converterGravatar Vivaan Verma-4/+4
2021-04-19Inline duration assignmentGravatar Vivaan Verma-2/+1
Co-authored-by: Rohan Reddy Alleti <[email protected]>
2021-04-19Update comment in list stream for readibilityGravatar Chris-1/+1
2021-04-19CamelCase the cog nameGravatar Boris Muratov-3/+3
2021-04-19Improve the wording of the list streamers embedGravatar ChrisJL-1/+1
Co-authored-by: Matteo Bertucci <[email protected]>
2021-04-19Remove unnecessary _ in variable nameGravatar Chris-3/+3
2021-04-19Update wording of comment to be clearer.Gravatar Chris-1/+1
2021-04-19Add command to list users with streaming permsGravatar Chris-1/+43
This is useful to audit users who still have the permission to stream. I have chosen to also sort and paginate the embed to make it easier to read. The sorting is based on how long until the user's streaming permissions are revoked, with permanent streamers at the end.
2021-04-19Require a mod role for stream commandsGravatar Chris-4/+4
Previously any staff member (including helpers) could use the stream commands.
2021-04-19Fix zen's negative indexingGravatar francisdbillones-1/+1
Negative indexing starts at -1, not 0, meaning lower bound should be -1 * len(zen_lines), not -1 * upper_bound.
2021-04-19Renamed duty.py to modpings.pyGravatar mbaruh-0/+0
2021-04-19Renamed Duty cog to ModpingsGravatar mbaruh-23/+23
The renaming includes the commands inside it.
2021-04-18Fix linting errorsGravatar Vivaan Verma-1/+1
2021-04-18Check if a duration was providedGravatar Vivaan Verma-2/+3
2021-04-18Make duration an optional arg and default it to 1 hourGravatar Vivaan Verma-1/+5
2021-04-18Added default duration of 1h to superstarifyGravatar Vivaan Verma-1/+1
2021-04-17Remove here pingGravatar Boris Muratov-2/+2
Kinda defeats the purpose of being off-duty.
2021-04-17Name the rescheduling task, and cancel it on cog unloadGravatar mbaruh-1/+2
2021-04-17Improve documentationGravatar mbaruh-1/+3
2021-04-17Assume a scheduled task exists for `duty on`Gravatar mbaruh-2/+1
The lack of such a task may be indicative of a bug.
2021-04-17Keep config succintGravatar mbaruh-2/+0
A moderator is expected to have the mod-team role and therefore it's enough to specify the latter in the mod and staff roles.
2021-04-16Raise a new NotInBlacklistCheckFailure insteadGravatar mbaruh-7/+15
This creates a new baseclass called ContextCheckFailure, and the new error as well as InWhitelistCheckFailure now derive it.
2021-04-15Allow eval almost everywhereGravatar mbaruh-5/+44
Adds a check to blacklist a command only in a specific context, with an option for a role override. The check is applied to the eval command to blacklist it only from python-general.
2021-04-15chore: update wording as requestedGravatar vcokltfre-3/+3
2021-04-15Use set instead of update in duty offGravatar mbaruh-1/+1
2021-04-15Add off-duty expiration date to audit logGravatar mbaruh-2/+2
2021-04-15Fix setup docstring to specify correct cogGravatar mbaruh-1/+1
2021-04-15Remove extra newlineGravatar Boris Muratov-1/+0
Co-authored-by: ks129 <[email protected]>
2021-04-14Add Duty cog and new Moderators roleGravatar mbaruh-4/+143
Added a cog to allow moderators to go off and on duty. The off-duty state is cached via a redis cache, and its expiry is scheduled via the Scheduler. Additionally changes which roles are pinged on mod alerts.
2021-04-14Refactor embed to use just one lineGravatar Chris-3/+1
2021-04-14Catch NotFound errors when trying to delete the invocation message when cleaningGravatar Chris-2/+6
This often happens during a raid, when an int e script is added to ban & clean messages. Since the invocation message will be deleted on the first run, we should except subsequent NotFound errors.
2021-04-14Require at least one snowflake to be provided.Gravatar Chris-0/+3
2021-04-14Use a paginated embed to output multiple snowflakesGravatar Chris-9/+18
Previously each snowflake passed to the command would have their own embed, which may cause the bot to send many embeds if a staff unknowingly passed it a bunch of snowflakes. This change makes sure that we don't run into rate limits on the bot by sending all of the snowflakes in one embed.
2021-04-13Branding: adjust duration string for 1-day eventsGravatar kwzrd-0/+5
Instead of: 'January 1 - January 1' Do: 'January 1'
2021-04-13Branding: use tz-aware datetime representationGravatar kwzrd-7/+8
Using `datetime.utcnow` produces a tz-naive object. When converting the object into a POSIX timestamp (L212), the library then converts the naive object into UTC, which will offset it unless the local timezone is UTC. We prevent this behaviour by using an Arrow repr instead, which is by default tz-aware. Since the object already knows it is in UTC, it does not shift when converting to a timestamp. Because L233 used `fromtimestamp` rather than `utcfromtimestamp`, the timestamp then got converted back into local time, canceling the previous error. Therefore, the bug wasn't observable from logs, as the times looked correct, but were being stored incorrectly. By using `Arrow.utcfromtimestamp`, the created object will be aware of being UTC again, which is more safe.
2021-04-12Remove reactions from everyone when paginating and waiting for trashcan ↵Gravatar ToxicKidz-44/+68
reaction. (#1471) * Remove reactions from everyone * Make flake8 happy * Make flake8 happy again * Remove reactions in check functions * Make flake8 happy for the last time * Update bot/pagination.py Co-authored-by: Kieran Siek <[email protected]> * Make create_task one line and return False in checks * Fix return so it returns either True or False * Use scheduling.create_task and suppress HTTPException * Suppress HTTPException in scheduling.create_task * Remove double if-statements Co-authored-by: Mark <[email protected]> * change suppress_exceptions to suppressed_exceptions * Make suppressed_exceptions a kwargs for _log_task_exception * Update scheduling.create_task call to correspond with *args * Fix NameError: reaction, user -> reaction_, user_ * Update scheduling.create_task call to correspond with *args in messages.wait_for_deletion * reaction -> reaction_ * Ignore reactions from the bot * Fix type annotations for create_task * Refactor add_reaction check to a separate function * Name the remove_reaction task Co-authored-by: Kieran Siek <[email protected]> Co-authored-by: Mark <[email protected]>
2021-04-12Use == instead of str.startswithGravatar ToxicKidz-2/+3
2021-04-11Sort the available help channels in #how-to-get-help by positionGravatar ToxicKidz-1/+3
2021-04-11Filtering: use a more thorough regex for zalgo & invisible charsGravatar MarkKoz-35/+91
Install the regex package to take advantage of its support for Unicode categories.
2021-04-11Recruitment: Don't use emoji literalsGravatar Matteo Bertucci-9/+9
2021-04-09AntiSpam: create tasks in a safer mannerGravatar MarkKoz-8/+9
Name the tasks and use `scheduling.create_task` to ensure exceptions are caught.