Skip to content

Update CurrentApplicationInfo and add support for editing it#3035

Closed
ivinjabraham wants to merge 171 commits intoserenity-rs:nextfrom
ivinjabraham:current
Closed

Update CurrentApplicationInfo and add support for editing it#3035
ivinjabraham wants to merge 171 commits intoserenity-rs:nextfrom
ivinjabraham:current

Conversation

@ivinjabraham
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@jamesbt365
Copy link
Copy Markdown
Member

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

arqunis and others added 8 commits December 8, 2024 13:23
This was missing on FullEvent but was present within the event itself.
Values are getting quite close to the u8 limit (193), so let's
preemptively bump this to avoid future breaking changes.
Moves the feature-gated collector methods on `UserId`, `MessageId`, etc.
into four traits:
- `CollectMessages` 
- `CollectReactions`
- `CollectModalInteractions` 
- `CollectComponentInteractions`

This also moves the quick modal machinery into the collector module and defines
a `QuickModal` trait. 

This fully removes any collector feature gates from the model types.
This file was removed from the module tree but never actually deleted.
…rs#3075)

Similar to message URLs, Discord also provides URLs for guild channels.

Additionally, the function is added as an alternative for parsing a `Channel` from a string. 
Private channels are not affected by this change.
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
Copy Markdown
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.

pub slug: FixedString,
#[serde(default)]
pub cover_image: Option<FixedString>,
pub cover_image: FixedString,
Copy link
Copy Markdown
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
@arqunis arqunis force-pushed the next branch 2 times, most recently from 57c79ff to 9a811a7 Compare March 11, 2025 22:17
@GnomedDev
Copy link
Copy Markdown
Member

This PR looks to be idle and therefore I am closing it to clean up the PR list, if anyone wants to pick up this and resolve the existing review comments here feel free to open a new PR.

@GnomedDev GnomedDev closed this Jul 25, 2025
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