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

Update CurrentApplicationInfo and add support for editing it #3035

Open
wants to merge 3 commits into
base: next
Choose a base branch
from

Conversation

ivinjabraham
Copy link
Contributor

@ivinjabraham ivinjabraham commented Nov 13, 2024

Fixes #2977

@github-actions github-actions bot added the http Related to the `http` module. label Nov 13, 2024
Copy link
Member

@jamesbt365 jamesbt365 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the provided to_vec function instead of importing it from serde_json.

@jamesbt365
Copy link
Member

Also you haven't added anything but the low level http interface? Http usually shouldn't be directly used and you should probably add a builder like how our other stuff interacts with http.

@ivinjabraham
Copy link
Contributor Author

Use the provided to_vec function instead of importing it from serde_json.

Pesky auto-import. Should be fixed now.

Also you haven't added anything but the low level http interface? Http usually shouldn't be directly used and you should probably add a builder like how our other stuff interacts with http.

Right, so I'll make a edit_current_application_info.rs and impl Builder along with the required structs and methods?

@ivinjabraham
Copy link
Contributor Author

ivinjabraham commented Nov 15, 2024

It seems the CurrentApplicationInfo struct is out of date. There are few fields such as event_webhook_url and event_webhook_status that are missing. I'll send in a PR for that first.

Doc for reference

@ivinjabraham ivinjabraham changed the base branch from current to next November 15, 2024 15:09
@ivinjabraham ivinjabraham force-pushed the current branch 2 times, most recently from 5ba44d9 to 24ffd92 Compare November 15, 2024 15:45
@github-actions github-actions bot added the model Related to the `model` module. label Nov 17, 2024
@github-actions github-actions bot added the builder Related to the `builder` module. label Nov 17, 2024
@ivinjabraham ivinjabraham force-pushed the current branch 3 times, most recently from 20d45ab to 8fd6b7e Compare November 17, 2024 16:41
Copy link
Member

@jamesbt365 jamesbt365 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit_current_appllication_info.rs -> edit_current_application_info.rs

@ivinjabraham ivinjabraham force-pushed the current branch 2 times, most recently from 8c6dd76 to 6a5d2a5 Compare November 17, 2024 18:04
@ivinjabraham ivinjabraham marked this pull request as ready for review November 18, 2024 03:43
src/model/application/mod.rs Outdated Show resolved Hide resolved
src/model/application/mod.rs Outdated Show resolved Hide resolved
src/builder/edit_current_application_info.rs Outdated Show resolved Hide resolved
@jamesbt365
Copy link
Member

I think everything in CurrentApplicationInfo can use FixedString (String replacment) and FixedArray (Vec replacement)

Comment on lines +91 to +101
/// Icon for the app
pub fn icon(mut self, base64_image_data: String) -> Self {
self.icon = Some(base64_image_data);
self
}

/// Sets the default rich presence invite cover image using base64 image data.
pub fn cover_image(mut self, base64_image_data: String) -> Self {
self.cover_image = Some(base64_image_data);
self
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than passing in base64 data manually as a String, we should allow the user to decide the place they want to source the image from and convert it to base64 on their behalf, similar to how EditProfile::avatar does it using CreateAttachment.

#[serde(default)]
pub cover_image: Option<FixedString>,
pub cover_image: FixedString,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the application icon, the API returns a hash of a constant size, so this should use ImageHash to store the hash inline. Also should be wrapped in an Option<...>.

@arqunis arqunis changed the title add support for edit_current_application endpoint Update CurrentApplicationInfo and add support for editing it Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builder Related to the `builder` module. http Related to the `http` module. model Related to the `model` module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing endpoint: Edit Current Application
5 participants