aboutsummaryrefslogtreecommitdiff
path: root/src/model/guild.rs
diff options
context:
space:
mode:
authorAustin Hellyer <[email protected]>2017-01-15 17:01:46 -0800
committerAustin Hellyer <[email protected]>2017-01-15 17:01:46 -0800
commit41b67c60bf3a6d87d6d80595bdaa00a8d9d0590a (patch)
tree9e3f8c80c367159d39bebfe40f75ee96c4597693 /src/model/guild.rs
parentDon't reconnect on WS error within some time (diff)
downloadserenity-41b67c60bf3a6d87d6d80595bdaa00a8d9d0590a.tar.xz
serenity-41b67c60bf3a6d87d6d80595bdaa00a8d9d0590a.zip
First round of deleting useless methods
Diffstat (limited to 'src/model/guild.rs')
-rw-r--r--src/model/guild.rs21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/model/guild.rs b/src/model/guild.rs
index 7b8ed60..9b0c321 100644
--- a/src/model/guild.rs
+++ b/src/model/guild.rs
@@ -160,12 +160,6 @@ impl PartialGuild {
rest::edit_nickname(self.id.0, new_nickname)
}
- /// Finds a role by Id within the guild.
- #[cfg(feature="methods")]
- pub fn find_role<R: Into<RoleId>>(&self, role_id: R) -> Option<&Role> {
- self.roles.get(&role_id.into())
- }
-
/// Returns a formatted URL of the guild's icon, if the guild has an icon.
pub fn icon_url(&self) -> Option<String> {
self.icon.as_ref().map(|icon|
@@ -271,7 +265,7 @@ impl PartialGuild {
impl Guild {
#[cfg(all(feature="cache", feature="methods"))]
fn has_perms(&self, mut permissions: Permissions) -> Result<bool> {
- let member = match self.get_member(CACHE.read().unwrap().user.id) {
+ let member = match self.members.get(&CACHE.read().unwrap().user.id) {
Some(member) => member,
None => return Err(Error::Client(ClientError::ItemMissing)),
};
@@ -577,14 +571,6 @@ impl Guild {
rest::edit_nickname(self.id.0, new_nickname)
}
- /// Attempts to retrieve a [`GuildChannel`] with the given Id.
- ///
- /// [`GuildChannel`]: struct.GuildChannel.html
- pub fn get_channel<C: Into<ChannelId>>(&self, channel_id: C)
- -> Option<&GuildChannel> {
- self.channels.get(&channel_id.into())
- }
-
/// Retrieves the active invites for the guild.
///
/// **Note**: Requires the [Manage Guild] permission.
@@ -610,11 +596,6 @@ impl Guild {
rest::get_guild_invites(self.id.0)
}
- /// Attempts to retrieve the given user's member instance in the guild.
- pub fn get_member<U: Into<UserId>>(&self, user_id: U) -> Option<&Member> {
- self.members.get(&user_id.into())
- }
-
/// Retrieves the first [`Member`] found that matches the name - with an
/// optional discriminator - provided.
///