aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
* | | | | | | | | [stat] Create a statistic for whether dormant was called by the claimant or ↵Gravatar Joseph Banks2020-04-12-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | staff
* | | | | | | | | Merge branch 'Numerlor-help-dormant-feedback' into `master`Gravatar Sebastiaan Zeeff2020-04-12-10/+53
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After resolving the merge conflicts created by the recent stats addition, I'm merging this into master. No functional changes were made during conflict resolution (hopefully) and the merge has been tested.
| * | | | | | | | | Merge branch 'help-dormant-feedback' of https://github.com/Numerlor/bot into ↵Gravatar Sebastiaan Zeeff2020-04-12-10/+53
|/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Numerlor-help-dormant-feedback
| * | | | | | | | | Fix `help_channel_claimants` typehint.Gravatar Numerlor2020-04-10-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ctx.author` that is used to populate the dict returns a `Member` object in most cases while only `User` was documented as a possible value.
| * | | | | | | | | Use synchronized permission reset.Gravatar Numerlor2020-04-10-1/+1
| | | | | | | | | |
| * | | | | | | | | Specify encoding to logging file handler.Gravatar Numerlor2020-04-09-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new addition of non latin-11 chars in channel names - which get logged, the logging to files fails on those entries on OSs where the default encoding is not utf8 or an other encoding capable of handling them.
| * | | | | | | | | Delete channel from claimant cache.Gravatar Numerlor2020-04-09-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deleting the channel from the claimant cache on invokation of the dormant command prevents users running the command multiple times before the bot moves it.
| * | | | | | | | | Reverse order of moving to dormant and task cancellation.Gravatar Numerlor2020-04-09-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reversing the order ensures the task is not cancelled when moving to dormant fails which gives a fallback to move it after the initial period of time.
| * | | | | | | | | HelpChannels: check author of dormant messageGravatar MarkKoz2020-04-09-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a testing environment, the bot may try to edit the message of a different bot. Therefore, the author of the message should be checked to ensure the current bot sent it.
| * | | | | | | | | Suppress errors when resetting permissions.Gravatar Numerlor2020-04-09-1/+2
| | | | | | | | | |
| * | | | | | | | | Move permissions reset up.Gravatar Numerlor2020-04-09-1/+2
| | | | | | | | | |
| * | | | | | | | | Move message deletion up.Gravatar Numerlor2020-04-09-3/+4
| | | | | | | | | |
| * | | | | | | | | Reword comment.Gravatar Numerlor2020-04-09-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: MarkKoz <[email protected]>
| * | | | | | | | | Add spacing.Gravatar Numerlor2020-04-09-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-authored-by: MarkKoz <[email protected]>
| * | | | | | | | | Reword strings to reflect name changes.Gravatar Numerlor2020-04-09-6/+6
| | | | | | | | | |
| * | | | | | | | | Change names to more descriptive ones.Gravatar Numerlor2020-04-09-6/+6
| | | | | | | | | |
| * | | | | | | | | Delete overwrite instead of send_messages permission.Gravatar Numerlor2020-04-09-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only resetting the permission caused the overwrites for the users to remain on the category, potentially piling up and causing further issues.
| * | | | | | | | | Reverse help_channel_user pairs.Gravatar Numerlor2020-04-09-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pairing users to channels was a design flaw, because the keys didn't get overwritten. This allowed multiple users to access the dormant command for the running session of the bot. Replacing this with a reversed paring fixes both issues because the cache is overwritten on channel activation.
| * | | | | | | | | Cancel permission restoration task.Gravatar Numerlor2020-04-09-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the dormant command is used and the permissions are restored for the user that started the session, the task for restoring them after the claim time has passed is no longer necessary.
| * | | | | | | | | Handle dormant invokation not being found.Gravatar Numerlor2020-04-09-1/+4
| | | | | | | | | |
| * | | | | | | | | Extend docstrings to include new behaviour.Gravatar Numerlor2020-04-09-1/+7
| | | | | | | | | |
| * | | | | | | | | Reset cooldown after channel is made dormant.Gravatar Numerlor2020-04-09-0/+14
| | | | | | | | | |
| * | | | | | | | | Allow help session starters to invoke dormant.Gravatar Numerlor2020-04-09-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing the `with_role` check from the command and replcaing it with a new `dormant_check` that's used in the body, which also checks against a cache of users that started the sessions, allows them to close their own channels along with the role check.
| * | | | | | | | | Remove dormant invokation message after move.Gravatar Numerlor2020-04-09-0/+1
| | | | | | | | | |
* | | | | | | | | | timer -> timing for statsdGravatar Joseph Banks2020-04-12-2/+2
| | | | | | | | | |
* | | | | | | | | | Use underscore for metric names instead of dashGravatar Joseph Banks2020-04-12-1/+1
| | | | | | | | | |
* | | | | | | | | | Add a timeout to prevent the bot from being overloaded with presence updatesGravatar Joseph Banks2020-04-12-5/+21
| | | | | | | | | |
* | | | | | | | | | Merge pull request #876 from python-discord/statsGravatar Joseph2020-04-12-38/+272
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | | StatsD integration
| * | | | | | | | | Address aeros' review comment regarding help channel stat reportingGravatar Joseph Banks2020-04-12-3/+3
| | | | | | | | | |
| * | | | | | | | | Add a metric for tracking how long defcon was activeGravatar Joseph Banks2020-04-11-1/+15
| | | | | | | | | |
| * | | | | | | | | Merge masterGravatar Joseph Banks2020-04-11-1/+1
| |\ \ \ \ \ \ \ \ \
| | * | | | | | | | | Update bot/cogs/stats.pyGravatar Joseph2020-04-11-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Mark <[email protected]>
| * | | | | | | | | | Use in for membership check as opposed to .get()Gravatar Joseph Banks2020-04-11-1/+1
| |/ / / / / / / / /
| * | | | | | | | | Additional statisticsGravatar Joseph Banks2020-04-11-9/+45
| | | | | | | | | |
| * | | | | | | | | Merge branch 'master' into statsGravatar Joseph2020-04-11-0/+0
| |\ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | |
* | | | | | | | | | Stop setting positions when moving help channelsGravatar Sebastiaan Zeeff2020-04-08-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.
| * | | | | | | | Move create_socket to the login method of the botGravatar Joseph Banks2020-04-11-4/+1
| | | | | | | | |
| * | | | | | | | Implement an AsyncStatsClient to send statsd communications asynchronouslyGravatar Joseph Banks2020-04-11-3/+49
| | | | | | | | |
| * | | | | | | | Address review comments from MarkGravatar Joseph Banks2020-04-11-3800/+5
| | | | | | | | |
| * | | | | | | | Address review comments from MarkGravatar Joseph Banks2020-04-11-14/+3837
| | | | | | | | |
| * | | | | | | | StatsD integrationGravatar Joseph Banks2020-04-11-34/+145
|/ / / / / / / /
* | | | | | | | Merge pull request #873 from ↵Gravatar Sebastiaan Zeeff2020-04-07-6/+51
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | python-discord/mitigate-permission-unsynchronization-available-help-channels Mitigate available help channels failing to synchronize their permissions
| * | | | | | | | Ensure available help channels sync their permissionsGravatar Sebastiaan Zeeff2020-04-07-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.
| * | | | | | | | Change help available embed to use occupied termGravatar Sebastiaan Zeeff2020-04-07-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.
* | | | | | | | Merge pull request #871 from ↵Gravatar Sebastiaan Zeeff2020-04-07-20/+24
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | python-discord/help-channel-system-minor-improvements Add status emojis to help channels and improve bottom sorting
| * | | | | | | | Set the ID of the new Help: In Use categoryGravatar Sebastiaan Zeeff2020-04-07-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.
| * | | | | | | | Use clean help channel name for used name setGravatar Sebastiaan Zeeff2020-04-06-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.
| * | | | | | | | Use configurable prefix to clean help channel namesGravatar Sebastiaan Zeeff2020-04-06-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.
| * | | | | | | | Change bottom sorting strategy to using a large intGravatar Sebastiaan Zeeff2020-04-06-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.
| * | | | | | | | Add channel status emoji to help channelsGravatar Sebastiaan Zeeff2020-04-06-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.