aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | * | | | | | | | | | 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
| | |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / / | |/| | | | | | | | | |
| | * | | | | | | | | | 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
| | |/ / / / / / / / /
| | | * | | | | | | | (Syncer Tests): Replaced wrong side effectGravatar ks1292020-04-09-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced `TimeoutError` with `asyncio.TimeoutError`.
| | | * | | | | | | | (Syncers): Fixed wrong except statementGravatar ks1292020-04-09-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaced `TimeoutError` with `asyncio.TimeoutError`.
| | | | * | | | | | | HelpChannels: ensure `is_in_category` returns a boolGravatar Mark2020-04-17-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: kwzrd <[email protected]>
| | | | * | | | | | | HelpChannels: create helper method for checking channel's categoryGravatar MarkKoz2020-04-11-4/+8
| | | | | | | | | | |
| | | | * | | | | | | HelpChannels: create a helper method for checking a channGravatar MarkKoz2020-04-11-2/+4
| | |_|/ / / / / / / | |/| | | | | | | |
| | | | * | | | | | Tags: explicitly use UTF-8 to read filesGravatar MarkKoz2020-04-10-1/+1
| | |_|/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all operating systems use UTF-8 as the default encoding. For systems that don't, reading tag files with Unicode would cause an unhandled exception.
| * | | | | | | | 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.
| * | | | | | | 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.
| * | | | | | | Change help channel sorting to bottom positionGravatar Sebastiaan Zeeff2020-04-05-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.
| * | | | | | | Merge pull request #786 from python-discord/feat/frontend/o200/help-channelsGravatar Joseph2020-04-05-145/+887
| |\ \ \ \ \ \ \ | | |/ / / / / / | |/| | | | | | Implement a new help channel system
| | * | | | | | Merge branch 'master' into feat/frontend/o200/help-channelsGravatar Joseph2020-04-05-316/+906
| | |\ \ \ \ \ \ | | |/ / / / / / | |/| | | | | |
| | * | | | | | Add close alias for dormant commandGravatar Joseph Banks2020-04-05-1/+1
| | | | | | | |
| | * | | | | | Reduce span of hyperlink in AVAILABLE_MSG and DORMANT_MSGGravatar Joseph Banks2020-04-05-2/+2
| | | | | | | |
| | * | | | | | HelpChannels: set to enabled by defaultGravatar MarkKoz2020-03-30-1/+1
| | | | | | | |
| | * | | | | | ModLog: ignore update channel events for help channelsGravatar MarkKoz2020-03-30-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.
| | * | | | | | HelpChannels: use constant names instead of default values in docstringGravatar MarkKoz2020-03-30-6/+5
| | | | | | | |
| | * | | | | | HelpChannels: fix typos in docstringsGravatar Mark2020-03-30-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Co-Authored-By: Leon Sandøy <[email protected]>
| | * | | | | | HelpChannels: fix typo in docstringGravatar MarkKoz2020-03-29-1/+1
| | | | | | | |
| | * | | | | | BotCog: fix AttributeError getting a category for a DMChannelGravatar MarkKoz2020-03-29-1/+1
| | | | | | | |
| | * | | | | | HelpChannels: remove positions from element namesGravatar MarkKoz2020-03-29-127/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no longer a reliance on static alphabetical position numbers.
| | * | | | | | HelpChannels: fix alphabetical sorting of dormant channelsGravatar MarkKoz2020-03-29-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]>
| | * | | | | | Constants: add a config value to toggle help channels extensionGravatar MarkKoz2020-03-22-6/+10
| | | | | | | |
| | * | | | | | HelpChannels: mention the helper notifications in cog docstringGravatar MarkKoz2020-03-22-0/+1
| | | | | | | |
| | * | | | | | HelpChannels: set idle minutes to 30 & max total channels to 32Gravatar MarkKoz2020-03-22-2/+2
| | | | | | | |
| | * | | | | | HelpChannels: write channel topicsGravatar MarkKoz2020-03-22-4/+14
| | | | | | | |
| | * | | | | | Resources: add newline to end of elements.jsonGravatar MarkKoz2020-03-22-1/+1
| | | | | | | |
| | * | | | | | HelpChannels: remove permission overwrites completelyGravatar MarkKoz2020-03-22-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resetting a specific permission still keeps the overwrite for the member around despite having default values. These will accumulate over time so they should be completely removed once the permission needs to be reset.
| | * | | | | | HelpChannels: use constant for command prefix in notificationGravatar MarkKoz2020-03-22-1/+1
| | | | | | | |
| | * | | | | | HelpChannels: fix unawaited coro warning for set_permissionsGravatar MarkKoz2020-03-22-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was happening when attempting to schedule a task twice for a user. Because the scheduler refuses to schedule a duplicate, the coroutine is deallocated right away without being awaited (or closed explicitly by `scheduled_task`). To fix, any existing task is cancelled before scheduling. This also means if somehow a user bypasses the lack of permissions, their cooldown will be updated. However, it probably doesn't make a difference as if they can bypass once, they likely can bypass again.
| | * | | | | | HelpChannels: fix unawaited coro warningGravatar MarkKoz2020-03-22-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Explicitly close the callback if it's a coroutine.
| | * | | | | | HelpChannels: remove name attribute access for channels in logsGravatar MarkKoz2020-03-22-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can rely on `__str__` already being a channel's name.
| | * | | | | | HelpChannels: make category checks direct & efficientGravatar MarkKoz2020-03-22-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace retrieval of all channels of a category with a direct comparison of the categories themselves. In the case of the `on_message` listener, the change enables the check to be done before the lock acquisition. This is because it doesn't rely on the channels in the category to be up to date. In fact, it doesn't even need the category object so it can exit early without needing to wait for the cog to be ready.