-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overhaul command permission builders #2399
Merged
Merged
Conversation
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
github-actions
bot
added
builder
Related to the `builder` module.
client
Related to the `client` module.
http
Related to the `http` module.
model
Related to the `model` module.
labels
Apr 23, 2023
Noticing the delay of merging: I made these changes because it makes more sense to do things this way imho - however, as always, I'm not sure if this gain for new code outweighs the churn for existing code. If others believe the breaking change of this PR is not worth it, I'm ok with not having this PR merged. |
arqunis
approved these changes
May 3, 2023
arqunis
added
enhancement
An improvement to Serenity.
breaking change
The public API is changed, resulting in miscompilations or unexpected new behaviour for users
labels
May 3, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 7, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 7, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 7, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 7, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 17, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 17, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 17, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 17, 2023
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
May 18, 2023
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
May 19, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 21, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 21, 2023
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
May 30, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 30, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
May 30, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 3, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 3, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 26, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Jun 26, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Aug 28, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Aug 28, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 6, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 6, 2023
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 21, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 21, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 21, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 21, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Sep 21, 2023
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 17, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 23, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 23, 2023
mkrasnitski
pushed a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 24, 2023
arqunis
pushed a commit
to arqunis/serenity
that referenced
this pull request
Oct 24, 2023
arqunis
pushed a commit
to arqunis/serenity
that referenced
this pull request
Oct 24, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 24, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Oct 24, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Nov 1, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Nov 1, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Nov 19, 2023
mkrasnitski
added a commit
to mkrasnitski/serenity
that referenced
this pull request
Nov 19, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking change
The public API is changed, resulting in miscompilations or unexpected new behaviour for users
builder
Related to the `builder` module.
client
Related to the `client` module.
enhancement
An improvement to Serenity.
http
Related to the `http` module.
model
Related to the `model` module.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CreateCommandPermissionsData
builder toEditCommandPermissions
edit_guild_command_permissions
endpointCreateCommandPermissionData
builder toCreateCommandPermission
CommandPermission
model type toCommandPermissions
CommandPermissionData
toCommandPermission
[GuildId, Guild, PartialGuild]::create_command_permission
toedit_command_permission
EditCommandPermissions
methodsnew()
,add_permission(CreateCommandPermission)
,set_permissions(Vec<CreateCommandPermission>)
with justnew(Vec<CreateCommandPermission>)
CreateCommandPermission
instances makes no sense, andnew(vec![a, b, c])
is easier for both serenity and the user thannew().add_permission(a).add_permission(b).add_permission(c)
CreateCommandPermissionData
methodsnew()
,kind(CommandPermissionType)
,id(CommandPermissionId)
,permission(bool)
withrole(RoleId, bool)
,user(UserId, bool)
,channel(ChannelId, bool)
kind
could mismatch the type of ID you passed in)CreateCommandPermission::everyone(GuildId, bool)
andCreateCommandPermission::all_channels(GuildId, bool)
edit_guild_commands_permissions
endpointedit_guild_command_permissions
(note the plural) - that endpoint is still active!CreateCommandPermission
's inner private fields by makingCreateCommandPermission
a newtype aroundCommandPermission
This PR has not been runtime tested