diff options
| author | Zeyla Hellyer <[email protected]> | 2017-09-01 20:29:11 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-09-01 20:39:40 -0700 |
| commit | 40031d9ec55b1a4dd6e350a7566ea230751a54ed (patch) | |
| tree | 0bf2b95623dc9416e9ac12444ceb89067f2178fb /src | |
| parent | Add case insensitivity (diff) | |
| download | serenity-40031d9ec55b1a4dd6e350a7566ea230751a54ed.tar.xz serenity-40031d9ec55b1a4dd6e350a7566ea230751a54ed.zip | |
Remove more non-bot user endpoints
These include the following functions removed:
- `http::get_application_info`
- `http::get_applications`
- `http::get_emoji`
- `http::get_emojis`
- `model::Guild::{emoji, emojis}`
- `model::GuildId::{emoji, emojis}`
- `model::PartialGuild::{emoji, emojis}`
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/mod.rs | 47 | ||||
| -rw-r--r-- | src/model/guild/guild_id.rs | 18 | ||||
| -rw-r--r-- | src/model/guild/mod.rs | 16 | ||||
| -rw-r--r-- | src/model/guild/partial_guild.rs | 16 |
4 files changed, 0 insertions, 97 deletions
diff --git a/src/http/mod.rs b/src/http/mod.rs index ab9bdb0..1478d8e 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -1000,26 +1000,6 @@ pub fn get_active_maintenances() -> Result<Vec<Maintenance>> { } } -/// Gets information about an oauth2 application that the current user owns. -/// -/// **Note**: Only user accounts may use this endpoint. -pub fn get_application_info(id: u64) -> Result<ApplicationInfo> { - let response = request!(Route::None, get, "/oauth2/applications/{}", id); - - serde_json::from_reader::<HyperResponse, ApplicationInfo>(response) - .map_err(From::from) -} - -/// Gets all oauth2 applications we've made. -/// -/// **Note**: Only user accounts may use this endpoint. -pub fn get_applications() -> Result<Vec<ApplicationInfo>> { - let response = request!(Route::None, get, "/oauth2/applications"); - - serde_json::from_reader::<HyperResponse, Vec<ApplicationInfo>>(response) - .map_err(From::from) -} - /// Gets all the users that are banned in specific guild. pub fn get_bans(guild_id: u64) -> Result<Vec<Ban>> { let response = request!( @@ -1149,33 +1129,6 @@ pub fn get_gateway() -> Result<Gateway> { .map_err(From::from) } -/// Gets information about an emoji. -pub fn get_emoji(guild_id: u64, emoji_id: u64) -> Result<Emoji> { - let response = request!( - Route::GuildsIdEmojisId(guild_id), - get, - "/guilds/{}/emojis/{}", - guild_id, - emoji_id - ); - - serde_json::from_reader::<HyperResponse, Emoji>(response) - .map_err(From::from) -} - -/// Gets all emojis in a guild. -pub fn get_emojis(guild_id: u64) -> Result<Vec<Emoji>> { - let response = request!( - Route::GuildsIdEmojis(guild_id), - get, - "/guilds/{}/emojis", - guild_id - ); - - serde_json::from_reader::<HyperResponse, Vec<Emoji>>(response) - .map_err(From::from) -} - /// Gets guild information. pub fn get_guild(guild_id: u64) -> Result<PartialGuild> { let response = request!(Route::GuildsId(guild_id), get, "/guilds/{}", guild_id); diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs index 4d6ba9b..350993a 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -303,24 +303,6 @@ impl GuildId { http::edit_role(self.0, role_id.into().0, &f(EditRole::default()).0) } - /// Gets an emoji in the guild by Id. - /// - /// Requires the [Manage Emojis] permission. - /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html - #[inline] - pub fn emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<Emoji> { - http::get_emoji(self.0, emoji_id.into().0) - } - - /// Gets a list of all of the guild's emojis. - /// - /// Requires the [Manage Emojis] permission. - /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html - #[inline] - pub fn emojis(&self) -> Result<Vec<Emoji>> { http::get_emojis(self.0) } - /// Search the cache for the guild. #[cfg(feature = "cache")] pub fn find(&self) -> Option<Arc<RwLock<Guild>>> { CACHE.read().unwrap().guild(*self) } diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index a690003..dee97af 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -605,22 +605,6 @@ impl Guild { self.id.edit_role(role_id, f) } - /// Gets an emoji in the guild by Id. - /// - /// Requires the [Manage Emojis] permission. - /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html - #[inline] - pub fn emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<Emoji> { self.id.emoji(emoji_id) } - - /// Gets a list of all of the guild's emojis. - /// - /// Requires the [Manage Emojis] permission. - /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html - #[inline] - pub fn emojis(&self) -> Result<Vec<Emoji>> { self.id.emojis() } - /// Gets a partial amount of guild data by its Id. /// /// Requires that the current user be in the guild. diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index 84d48d3..02cdbf5 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -284,22 +284,6 @@ impl PartialGuild { self.id.edit_nickname(new_nickname) } - /// Gets an emoji in the guild by Id. - /// - /// Requires the [Manage Emojis] permission. - /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html - #[inline] - pub fn emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<Emoji> { self.id.emoji(emoji_id) } - - /// Gets a list of all of the guild's emojis. - /// - /// Requires the [Manage Emojis] permission. - /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html - #[inline] - pub fn emojis(&self) -> Result<Vec<Emoji>> { self.id.emojis() } - /// Gets a partial amount of guild data by its Id. /// /// Requires that the current user be in the guild. |