-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
feat(model,http,http-ratelimiting): Add support for application role connections metadata get/set operations #2004
base: main
Are you sure you want to change the base?
Conversation
604bc63
to
0f4be11
Compare
0f4be11
to
e4494f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR! I left a lot of comments, I hope it doesn't scare you too much :).
@@ -1,2 +1,3 @@ | |||
pub mod command; | |||
pub mod interaction; | |||
pub mod role_connection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather place this into guild
.
@@ -0,0 +1,54 @@ | |||
//! Application role connections models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a more descriptive module description. Something summarizing what and why role connections exists would be ideal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is largely a wip at the moment, the docs are either placeholders or taken straight out of the discord's docs (the uncapitalized ones).
When it is deemed this PR makes sense I'll put more effort into correcting the docs, but for now, it's a bit premature.
pub key: String, | ||
/// name of the metadata field (max 100 characters) | ||
pub name: String, | ||
/// translations of the name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the localization items' documentation to follow the same style as CommandOption
?
@@ -1,2 +1,3 @@ | |||
pub mod command; | |||
pub mod interaction; | |||
pub mod role_connections; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with in twligiht-model
, I'd rather have this in guild
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what you're referring to. Just to be clear - this is the app-global part of the API, not the user-specific (or guild-specific) one.
mod get_metadata; | ||
mod set_metadata; | ||
|
||
pub use self::{get_metadata::GetMetadata, set_metadata::SetMetadata}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Naming could be improved, GetRoleConnection
and UpdateRoleConnection
sounds a bit better and more futureproof to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True! However, these ones are for configuring and reading the metadata for the role connections that app provides. There also has be an API for setting the actual values of the role connections per user (the @me API).
@@ -276,6 +278,14 @@ impl Client { | |||
InteractionClient::new(self, application_id) | |||
} | |||
|
|||
/// Create an interface for using application role connections. | |||
pub const fn role_connections( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unacceptable (not your fault), it's way to contrived. We need a RFC for how to handle routes requiring an application_id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fine! I'll use this for now in my code as I need something that works immediately. I'll be looking forward to the RFC and the proper implementation of this feature but it is unlikely I'll be taking part in the RFC process itself in the near future.
Great feedback, thank you @vilgotf! |
|
Sure! Feel free to take over, if needed - fork my branch and create a new one. I'd have no problem with that whatsoever. |
To do:
Refs: