diff options
| -rw-r--r-- | definitions/structs/current_application_info.yml | 2 | ||||
| -rw-r--r-- | src/client/rest/mod.rs | 17 |
2 files changed, 13 insertions, 6 deletions
diff --git a/definitions/structs/current_application_info.yml b/definitions/structs/current_application_info.yml index 74901c0..923518b 100644 --- a/definitions/structs/current_application_info.yml +++ b/definitions/structs/current_application_info.yml @@ -4,8 +4,6 @@ description: Information about the current application and its owner. fields: - name: description type: string - - name: flags - type: u64 - name: icon optional: true type: string diff --git a/src/client/rest/mod.rs b/src/client/rest/mod.rs index d44c4e2..5a03f37 100644 --- a/src/client/rest/mod.rs +++ b/src/client/rest/mod.rs @@ -896,13 +896,13 @@ pub fn get_active_maintenances() -> Result<Vec<Maintenance>> { } } -/// Gets information about an oauth2 application we own. +/// Gets information about an oauth2 application that the current user owns. /// /// **Note**: Only user accounts may use this endpoint. -pub fn get_application_info() -> Result<CurrentApplicationInfo> { - let response = request!(Route::None, get, "/oauth2/applications/@me"); +pub fn get_application_info(id: u64) -> Result<ApplicationInfo> { + let response = request!(Route::None, get, "/oauth2/applications/{}", id); - CurrentApplicationInfo::decode(serde_json::from_reader(response)?) + ApplicationInfo::decode(serde_json::from_reader(response)?) } /// Gets all oauth2 applications we've made. @@ -992,6 +992,15 @@ pub fn get_channels(guild_id: u64) -> Result<Vec<GuildChannel>> { GuildChannel::decode) } +/// Gets information about the current application. +/// +/// **Note**: Only applications may use this endpoint. +pub fn get_current_application_info() -> Result<CurrentApplicationInfo> { + let response = request!(Route::None, get, "/oauth2/applications/@me"); + + CurrentApplicationInfo::decode(serde_json::from_reader(response)?) +} + /// Gets information about the user we're connected with. pub fn get_current_user() -> Result<CurrentUser> { let response = request!(Route::UsersMe, get, "/users/@me"); |