-
Notifications
You must be signed in to change notification settings - Fork 947
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cc: implement new DiagnoseCCTriggers command (#1712)
* web: make ManageServerURL take guild ID directly This change unlocks using this function in a later commit (where we only have a guild ID, not the full guild data.) It's also more proper: ManageServerURL only needs the guild ID, so it need not be tied to dcmd. * cc: factor out CCActionExecLimit function The action of computing this limit is repeated throughout this file, so factor it out. Since we are using the limit for more than just messages, rename it appropriately. * cc: extract hasHigherPriority comparator Currently the comparator is internal to sortTriggeredCCs (which accepts a slice of *TriggeredCC), but we will need to sort a slice of custom commands directly to implement the debug command. Extract the comparator out, document the priority order, and then refactor the implementation for clarity. To prove that the old and new comparator implementations are functionally equivalent, see the following test: https://go.dev/play/p/NEUrG1wu0OI. It exhaustively enumerates all pairs of custom commands and ensures the old and new comparators agree. * cc: implement new DiagnoseCCTriggers command
- Loading branch information
Showing
6 changed files
with
164 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters