Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

@github-actions github-actions bot added c-http Affects the http crate c-http-ratelimiting Affects the http ratelimiting crate c-model Affects the model crate labels Dec 15, 2022
@MOZGIII MOZGIII changed the title Add support for application role connections metadata get/set operations feat(model,http,http-ratelimiting): Add support for application role connections metadata get/set operations Dec 15, 2022
@github-actions github-actions bot added the t-feature Addition of a new feature label Dec 15, 2022
Copy link
Member

@vilgotf vilgotf left a 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;
Copy link
Member

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.
Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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;
Copy link
Member

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.

Copy link
Contributor Author

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};
Copy link
Member

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.

Copy link
Contributor Author

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(
Copy link
Member

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.

Copy link
Contributor Author

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.

@vilgotf vilgotf added the w-unapproved Proposal for change has *not* been approved by @twilight-rs/core. label Dec 15, 2022
@MOZGIII
Copy link
Contributor Author

MOZGIII commented Dec 15, 2022

Great feedback, thank you @vilgotf!

@fusetim
Copy link

fusetim commented Sep 9, 2023

This PR seems dead, can I try to resume it?

@MOZGIII
Copy link
Contributor Author

MOZGIII commented Sep 9, 2023

Sure! Feel free to take over, if needed - fork my branch and create a new one. I'd have no problem with that whatsoever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-http Affects the http crate c-http-ratelimiting Affects the http ratelimiting crate c-model Affects the model crate t-feature Addition of a new feature w-unapproved Proposal for change has *not* been approved by @twilight-rs/core.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants