aboutsummaryrefslogtreecommitdiffstats
path: root/tests/base.py (unfollow)
Commit message (Collapse)AuthorLines
2020-04-12Add a timeout to prevent the bot from being overloaded with presence updatesGravatar Joseph Banks-5/+21
2020-04-12Address aeros' review comment regarding help channel stat reportingGravatar Joseph Banks-3/+3
2020-04-11Add a metric for tracking how long defcon was activeGravatar Joseph Banks-1/+15
2020-04-11Use in for membership check as opposed to .get()Gravatar Joseph Banks-1/+1
2020-04-11Update bot/cogs/stats.pyGravatar Joseph-1/+1
Co-Authored-By: Mark <[email protected]>
2020-04-11Additional statisticsGravatar Joseph Banks-9/+45
2020-04-11Move create_socket to the login method of the botGravatar Joseph Banks-4/+1
2020-04-11Implement an AsyncStatsClient to send statsd communications asynchronouslyGravatar Joseph Banks-3/+49
2020-04-11Address review comments from MarkGravatar Joseph Banks-3800/+5
2020-04-11Address review comments from MarkGravatar Joseph Banks-14/+3837
2020-04-11StatsD integrationGravatar Joseph Banks-34/+145
2020-04-08Stop setting positions when moving help channelsGravatar Sebastiaan Zeeff-2/+0
Unfortunately, trying to set positions for the help channels during their move from one category to another does not work to well. It introduces a number of glitches and we haven't been able to reliably get a channel to go to a specific position either. This commit simply removes any attempt to set a position and lets Discord handle it.
2020-04-07Ensure available help channels sync their permissionsGravatar Sebastiaan Zeeff-3/+48
The help channels in the `Help: Available` category should automatically synchronize their permissions with the category permissions to ensure that the overwrites we use to prevent people from claiming multiple help channels are properly enforced. Unfortunately, for unknown reasons, they sometimes get in an "out of sync" state that requires intervention to get them back in sync. This PR mitigates that issue by checking the available channel for their synchronisation status during certain critical times in our help channel system: 1. Whenever the overwrites for the category change 2. Whenever a channel is moved into the new category 3. After the categories have been reset during the initialization process The check is straightforward: The `ensure_permissions_synchronization` method iterates over all the channels in the category and checks if the channels are currently synchronizing their permissions. If not, we remedy that by making a channel edit request to the Discord API. If all channels were already "in sync", no API calls are made. The latter should make this an inexpensive mitigation procedure: As we typically have very few channels in the available category and channels mostly stay in sync, we typically do very little. To make this process a bit easier, I've factored out `set_permissions` calls to a helper function that also calls the `ensure_permissions_synchronization` method. The only exception is during the reset process: As we may edit multiple permissions in this loop, it's better to only ensure the synchronization after we're done with all permission changes.
2020-04-07Change help available embed to use occupied termGravatar Sebastiaan Zeeff-3/+3
The embed displayed in available help channels still used the term "in use" instead of "occupied". I've updated the embed to reflect the new name of the "occupied" category.
2020-04-07Set the ID of the new Help: In Use categoryGravatar Sebastiaan Zeeff-1/+1
As Discord is having a rather persistent issue with one of the channels in the current `Help: In Use` category, we're going to start using a new category that excludes the old channel. The old channel, help-argon, appears to be completely broken on Discord's end, resulting in "Not found" errors for any kind of interaction, including channel move and/or channel delete admin actions. As it's still visible, it's currently triggering a lot questions from our members. We hope that using a new category will fix that.
2020-04-06Use clean help channel name for used name setGravatar Sebastiaan Zeeff-1/+1
The set that keeps track of the used channel names should discard emojis. To do that, I'm cleaning the names before they're added to the set of channel names.
2020-04-06Use configurable prefix to clean help channel namesGravatar Sebastiaan Zeeff-3/+4
The help channel prefix is configurable as a constant, but I accidentally used a static prefix in the utility function that cleaned the channel names. This commit makes sure the utility method uses the prefix defined in the constants.
2020-04-06Change bottom sorting strategy to using a large intGravatar Sebastiaan Zeeff-21/+2
The current approach of trying to find the maximum channel position, adding one, and using that as the position integer for channels does not seem to work reliably. An approach that seems to work in the testing environment is using a very large integer for the position attribute of the channel: It wil be sorted at the bottom and Discord will automatically scale the integer down to `max + 1`. This also means the `get_position` utility function is no longer needed; it has been removed.
2020-04-06Add channel status emoji to help channelsGravatar Sebastiaan Zeeff-0/+22
I've added channel status emojis as a prefix to our help channels to make it more obvious to the end user what the current status of a channel is. All channels in the Available category will be marked with a green checkmark emoji, while all channels in the In Use category will be marked with an hourglass. Channels in the Dormant category stay unadorned. Channels will be stripped of their previous prefix when moved to another category. This relies on the `help-` naming convention, as that is the most reliable way to do it that does not break if we ever opt for another emoji.
2020-04-05Change help channel sorting to bottom positionGravatar Sebastiaan Zeeff-17/+6
The current sorting algorithm we used created unpredictable channel order (for our human end-users) and induced a flickering channel light-show in Discord clients. To combat these undesirable side-effects, I've changed the ordering to always order channels at the bottom of a category. This also means that channels looking for answers the longest will naturally float up.
2020-04-05Add close alias for dormant commandGravatar Joseph Banks-1/+1
2020-04-05Reduce span of hyperlink in AVAILABLE_MSG and DORMANT_MSGGravatar Joseph Banks-2/+2
2020-04-02Fixed missed rename for token removal method name changeGravatar S. Co1-1/+1
2020-04-01Add TCD to whitelistGravatar Leon Sandøy-0/+1
The Coding Den is a language agnostic community that's been around for years with over 12000 members. I think we can allow that invite in our community.
2020-03-31(Infraction Edit): Changed already expired and no reason provided sentence.Gravatar Karlis S-3/+1
Co-Authored-By: Mark <[email protected]>
2020-03-31(Infraction Edit): Don't change infraction when user try modify duration of ↵Gravatar ks123-0/+5
infraction that is already expired and reason not specified.
2020-03-31(Tags): Removed unnecessary `send_embed_with_trashcan` function due using ↵Gravatar ks123-23/+1
existing function.
2020-03-31(Tags): Moved to existing `wait_for_deletion` function instead using ↵Gravatar ks123-5/+17
custom/new one.
2020-03-31(Tags): Added blank line between check function and `try:` block on ↵Gravatar ks123-0/+1
`send_embed_with_trashcan` function.
2020-03-31(Tags): Fixed `TimeoutError` shadowing with `asyncio.TimeoutError`.Gravatar ks123-2/+2
2020-03-31(Tags): Modified helper function `handle_trashcan_react` to ↵Gravatar ks123-7/+6
`send_embed_with_trashcan`, applied to docstring and to command.
2020-03-30HelpChannels: set to enabled by defaultGravatar MarkKoz-1/+1
2020-03-30ModLog: ignore update channel events for help channelsGravatar MarkKoz-1/+7
The edit causes two channel update events to dispatch simultaneously: one for the channel topic changing and one for the category changing. The ModLog cog currently doesn't support ignoring multiple events of the same type for the same channel. Therefore, the ignore was hard coded rather than using the typical ignore mechanism. This is intended to be a temporary solution; it should be removed once the ModLog is changed to support this situation.
2020-03-30HelpChannels: use constant names instead of default values in docstringGravatar MarkKoz-6/+5
2020-03-30HelpChannels: fix typos in docstringsGravatar Mark-2/+2
Co-Authored-By: Leon Sandøy <[email protected]>
2020-03-30Set unsilence permissions to inherit instead of trueGravatar Sebastiaan Zeeff-2/+2
The "unsilence" action of the silence/hush command used `send_messages=True` when unsilencing a hushed channel. This had the side effect of also enabling send messages permissions for those with the Muted rule, as an explicit True permission apparently overwrites an explicit False permission, even if the latter was set for a higher top-role. The solution is to revert back to the `Inherit` permission by assigning `None`. This is what we normally use when Developers are allowed to send messages to a channel.
2020-03-30(Tags): Fixed trashcan handling check.Gravatar ks123-2/+2
2020-03-30(Tags): Added trashcan handling to `!tags get` command.Gravatar ks123-2/+4
2020-03-30(Tags): Added helper function `handle_trashcan_react` for tag response ↵Gravatar ks123-1/+21
deletion handling.
2020-03-29HelpChannels: fix typo in docstringGravatar MarkKoz-1/+1
2020-03-29BotCog: fix AttributeError getting a category for a DMChannelGravatar MarkKoz-1/+1
2020-03-29HelpChannels: remove positions from element namesGravatar MarkKoz-127/+125
There is no longer a reliance on static alphabetical position numbers.
2020-03-29HelpChannels: fix alphabetical sorting of dormant channelsGravatar MarkKoz-13/+22
When a channel is moved, all channels below have their positions incremented by 1. This threw off the previous implementation which relied on position numbers being static. Co-authored-by: Sebastiaan Zeeff <[email protected]>
2020-03-29(Infraction Edit): Don't let change expiration when infraction already expired.Gravatar Karlis S-1/+3
2020-03-29(PEP Command): Fixed comment about PEP 0 separately handling.Gravatar ks123-2/+1
2020-03-29(PEP Command): Moved PEP 0 information to hard-coded strings from constants, ↵Gravatar ks123-18/+14
moved PEP 0 sending to function.
2020-03-29(PEP Command): Moved icon URL to constant instead hard-coded string.Gravatar ks123-2/+4
2020-03-28Increase syncer logging levelGravatar S. Co1-1/+1
2020-03-28(Webhook Detection): Fixed grouping of regex, alert message content, ↵Gravatar Karlis S-9/+9
docstrings, string formatting and URL hiding to show in logs. Co-Authored-By: Mark <[email protected]>
2020-03-28Use debug log level instead of warning in `post_user`Gravatar MarkKoz-1/+1