aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authoracdenisSK <[email protected]>2017-07-11 22:13:57 +0200
committeracdenisSK <[email protected]>2017-07-11 22:13:57 +0200
commitebc4e51fe3b1e5bc61dc99da25a22d2e2277ffc6 (patch)
tree1eeee881705d8721cdb4238461e5422043a63ca1 /src/model
parentAdd a way to add multiple fields at once (diff)
downloadserenity-ebc4e51fe3b1e5bc61dc99da25a22d2e2277ffc6.tar.xz
serenity-ebc4e51fe3b1e5bc61dc99da25a22d2e2277ffc6.zip
Remove the deprecated functions
It's already been enough time for people to migrate
Diffstat (limited to 'src/model')
-rw-r--r--src/model/channel/channel_id.rs115
-rw-r--r--src/model/channel/group.rs64
-rw-r--r--src/model/channel/guild_channel.rs31
-rw-r--r--src/model/channel/message.rs10
-rw-r--r--src/model/channel/mod.rs95
-rw-r--r--src/model/channel/private_channel.rs64
-rw-r--r--src/model/guild/guild_id.rs91
-rw-r--r--src/model/guild/member.rs8
-rw-r--r--src/model/guild/mod.rs100
-rw-r--r--src/model/guild/partial_guild.rs91
-rw-r--r--src/model/guild/role.rs9
-rw-r--r--src/model/permissions.rs27
-rw-r--r--src/model/user.rs35
13 files changed, 0 insertions, 740 deletions
diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs
index 4cfd06c..e5f410b 100644
--- a/src/model/channel/channel_id.rs
+++ b/src/model/channel/channel_id.rs
@@ -366,70 +366,6 @@ impl ChannelId {
///
/// # Examples
///
- /// Send a file with the filename `my_file.jpg`:
- ///
- /// ```rust,no_run
- /// use serenity::model::ChannelId;
- /// use std::fs::File;
- ///
- /// let channel_id = ChannelId(7);
- /// let filename = "my_file.jpg";
- /// let file = File::open(filename).unwrap();
- ///
- /// let _ = channel_id.send_file(file, filename, |m| m.content("a file"));
- /// ```
- ///
- /// # Errors
- ///
- /// If the content of the message is over the above limit, then a
- /// [`ModelError::MessageTooLong`] will be returned, containing the number
- /// of unicode code points over the limit.
- ///
- /// Returns an
- /// [`HttpError::InvalidRequest(PayloadTooLarge)`][`HttpError::InvalidRequest`]
- /// if the file is too large to send.
- ///
- ///
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`CreateMessage::content`]: ../builder/struct.CreateMessage.html#method.content
- /// [`GuildChannel`]: struct.GuildChannel.html
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
- #[deprecated(since="0.2.0", note="Please use `send_files` instead.")]
- #[allow(deprecated)]
- pub fn send_file<F, R>(&self, file: R, filename: &str, f: F) -> Result<Message>
- where F: FnOnce(CreateMessage) -> CreateMessage, R: Read {
- let mut map = f(CreateMessage::default()).0;
-
- if let Some(content) = map.get("content") {
- if let Value::String(ref content) = *content {
- if let Some(length_over) = Message::overflow_length(content) {
- return Err(Error::Model(ModelError::MessageTooLong(length_over)));
- }
- }
- }
-
- let _ = map.remove("embed");
-
- http::send_file(self.0, file, filename, map)
- }
-
- /// Sends a file along with optional message contents. The filename _must_
- /// be specified.
- ///
- /// Message contents may be passed by using the [`CreateMessage::content`]
- /// method.
- ///
- /// An embed can _not_ be sent when sending a file. If you set one, it will
- /// be automatically removed.
- ///
- /// The [Attach Files] and [Send Messages] permissions are required.
- ///
- /// **Note**: Message contents must be under 2000 unicode code points.
- ///
- /// # Examples
- ///
/// Send files with the paths `/path/to/file.jpg` and `/path/to/file2.jpg`:
///
/// ```rust,no_run
@@ -548,57 +484,6 @@ impl ChannelId {
pub fn webhooks(&self) -> Result<Vec<Webhook>> {
http::get_channel_webhooks(self.0)
}
-
- /// Alias of [`invites`].
- ///
- /// [`invites`]: #method.invites
- #[deprecated(since="0.1.5", note="Use `invites` instead.")]
- #[inline]
- pub fn get_invites(&self) -> Result<Vec<RichInvite>> {
- self.invites()
- }
-
- /// Alias of [`message`].
- ///
- /// [`message`]: #method.message
- #[deprecated(since="0.1.5", note="Use `message` instead.")]
- #[inline]
- pub fn get_message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
- self.message(message_id)
- }
-
- /// Alias of [`messages`].
- ///
- /// [`messages`]: #method.messages
- #[deprecated(since="0.1.5", note="Use `messages` instead.")]
- #[inline]
- pub fn get_messages<F>(&self, f: F) -> Result<Vec<Message>>
- where F: FnOnce(GetMessages) -> GetMessages {
- self.messages(f)
- }
-
- /// Alias of [`reaction_users`].
- ///
- /// [`reaction_users`]: #method.reaction_users
- #[deprecated(since="0.1.5", note="Use `reaction_users` instead.")]
- #[inline]
- pub fn get_reaction_users<M, R, U>(&self,
- message_id: M,
- reaction_type: R,
- limit: Option<u8>,
- after: Option<U>)
- -> Result<Vec<User>> where M: Into<MessageId>, R: Into<ReactionType>, U: Into<UserId> {
- self.reaction_users(message_id, reaction_type, limit, after)
- }
-
- /// Alias of [`webhooks`].
- ///
- /// [`webhooks`]: #method.webhooks
- #[deprecated(since="0.1.5", note="Use `webhooks` instead.")]
- #[inline]
- pub fn get_webhooks(&self) -> Result<Vec<Webhook>> {
- self.webhooks()
- }
}
impl From<Channel> for ChannelId {
diff --git a/src/model/channel/group.rs b/src/model/channel/group.rs
index 8bb4e2c..0b4f380 100644
--- a/src/model/channel/group.rs
+++ b/src/model/channel/group.rs
@@ -278,37 +278,6 @@ impl Group {
self.channel_id.say(content)
}
- /// Sends a file along with optional message contents. The filename _must_
- /// be specified.
- ///
- /// Refer to [`ChannelId::send_file`] for examples and more information.
- ///
- /// The [Attach Files] and [Send Messages] permissions are required.
- ///
- /// **Note**: Message contents must be under 2000 unicode code points.
- ///
- /// # Errors
- ///
- /// Returns an
- /// [`HttpError::InvalidRequest(PayloadTooLarge)`][`HttpError::InvalidRequest`]
- /// if the file is too large to send.
- ///
- /// If the content of the message is over the above limit, then a
- /// [`ModelError::MessageTooLong`] will be returned, containing the number
- /// of unicode code points over the limit.
- ///
- /// [`ChannelId::send_file`]: struct.ChannelId.html#method.send_file
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
- #[deprecated(since="0.2.0", note="Please use `send_files` instead.")]
- #[allow(deprecated)]
- pub fn send_file<F, R>(&self, file: R, filename: &str, f: F) -> Result<Message>
- where F: FnOnce(CreateMessage) -> CreateMessage, R: Read {
- self.channel_id.send_file(file, filename, f)
- }
-
/// Sends (a) file(s) along with optional message contents.
///
/// Refer to [`ChannelId::send_files`] for examples and more information.
@@ -357,37 +326,4 @@ impl Group {
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self.channel_id.unpin(message_id)
}
-
- /// Alias of [`message`].
- ///
- /// [`message`]: #method.message
- #[deprecated(since="0.1.5", note="Use `message` instead.")]
- #[inline]
- pub fn get_message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
- self.message(message_id)
- }
-
- /// Alias of [`messages`].
- ///
- /// [`messages`]: #method.messages
- #[deprecated(since="0.1.5", note="Use `messages` instead.")]
- #[inline]
- pub fn get_messages<F>(&self, f: F) -> Result<Vec<Message>>
- where F: FnOnce(GetMessages) -> GetMessages {
- self.messages(f)
- }
-
- /// Alias of [`reaction_users`].
- ///
- /// [`reaction_users`]: #method.reaction_users
- #[deprecated(since="0.1.5", note="Use `reaction_users` instead.")]
- #[inline]
- pub fn get_reaction_users<M, R, U>(&self,
- message_id: M,
- reaction_type: R,
- limit: Option<u8>,
- after: Option<U>)
- -> Result<Vec<User>> where M: Into<MessageId>, R: Into<ReactionType>, U: Into<UserId> {
- self.reaction_users(message_id, reaction_type, limit, after)
- }
}
diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs
index 15a068e..f15fb91 100644
--- a/src/model/channel/guild_channel.rs
+++ b/src/model/channel/guild_channel.rs
@@ -545,37 +545,6 @@ impl GuildChannel {
self.id.say(content)
}
- /// Sends a file along with optional message contents. The filename _must_
- /// be specified.
- ///
- /// Refer to [`ChannelId::send_file`] for examples and more information.
- ///
- /// The [Attach Files] and [Send Messages] permissions are required.
- ///
- /// **Note**: Message contents must be under 2000 unicode code points.
- ///
- /// # Errors
- ///
- /// Returns an
- /// [`HttpError::InvalidRequest(PayloadTooLarge)`][`HttpError::InvalidRequest`]
- /// if the file is too large to send.
- ///
- /// If the content of the message is over the above limit, then a
- /// [`ModelError::MessageTooLong`] will be returned, containing the number
- /// of unicode code points over the limit.
- ///
- /// [`ChannelId::send_file`]: struct.ChannelId.html#method.send_file
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
- #[deprecated(since="0.2.0", note="Please use `send_files` instead.")]
- #[allow(deprecated)]
- pub fn send_file<F, R>(&self, file: R, filename: &str, f: F) -> Result<Message>
- where F: FnOnce(CreateMessage) -> CreateMessage, R: Read {
- self.id.send_file(file, filename, f)
- }
-
/// Sends (a) file(s) along with optional message contents.
///
/// Refer to [`ChannelId::send_files`] for examples and more information.
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs
index 6314cae..e1eccf0 100644
--- a/src/model/channel/message.rs
+++ b/src/model/channel/message.rs
@@ -490,16 +490,6 @@ impl Message {
http::unpin_message(self.channel_id.0, self.id.0)
}
- /// Alias of [`reaction_users`].
- ///
- /// [`reaction_users`]: #method.reaction_users
- #[deprecated(since="0.1.5", note="Use `reaction_users` instead.")]
- #[inline]
- pub fn get_reaction_users<R, U>(&self, reaction_type: R, limit: Option<u8>, after: Option<U>)
- -> Result<Vec<User>> where R: Into<ReactionType>, U: Into<UserId> {
- self.reaction_users(reaction_type, limit, after)
- }
-
pub(crate) fn check_content_length(map: &JsonMap) -> Result<()> {
if let Some(content) = map.get("content") {
if let Value::String(ref content) = *content {
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs
index 730410e..5c29a52 100644
--- a/src/model/channel/mod.rs
+++ b/src/model/channel/mod.rs
@@ -105,37 +105,6 @@ impl Channel {
self.id().delete_message(message_id)
}
- /// Deletes all messages by Ids from the given vector in the channel.
- ///
- /// The minimum amount of messages is 2 and the maximum amount is 100.
- ///
- /// Requires the [Manage Messages] permission.
- ///
- /// **Note**: This uses bulk delete endpoint which is not available
- /// for user accounts.
- ///
- /// **Note**: Messages that are older than 2 weeks can't be deleted using
- /// this method.
- ///
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
- #[deprecated(since="0.2.0", note="Use the inner channel's `delete_messages` method instead.")]
- #[inline]
- pub fn delete_messages(&self, message_ids: &[MessageId]) -> Result<()> {
- self.id().delete_messages(message_ids)
- }
-
- /// Deletes all permission overrides in the channel from a member
- /// or role.
- ///
- /// **Note**: Requires the [Manage Channel] permission.
- ///
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
- #[deprecated(since="0.2.0", note="Use the inner channel's `delete_permission` method instead.")]
- #[inline]
- pub fn delete_permission(&self, permission_type: PermissionOverwriteType) -> Result<()> {
- self.id().delete_permission(permission_type)
- }
-
/// Deletes the given [`Reaction`] from the channel.
///
/// **Note**: Requires the [Manage Messages] permission, _if_ the current
@@ -275,37 +244,6 @@ impl Channel {
self.id().say(content)
}
- /// Sends a file along with optional message contents. The filename _must_
- /// be specified.
- ///
- /// Refer to [`ChannelId::send_file`] for examples and more information.
- ///
- /// The [Attach Files] and [Send Messages] permissions are required.
- ///
- /// **Note**: Message contents must be under 2000 unicode code points.
- ///
- /// # Errors
- ///
- /// Returns an
- /// [`HttpError::InvalidRequest(PayloadTooLarge)`][`HttpError::InvalidRequest`]
- /// if the file is too large to send.
- ///
- /// If the content of the message is over the above limit, then a
- /// [`ModelError::MessageTooLong`] will be returned, containing the number
- /// of unicode code points over the limit.
- ///
- /// [`ChannelId::send_file`]: struct.ChannelId.html#method.send_file
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
- #[deprecated(since="0.2.0", note="Please use `send_files` instead.")]
- #[allow(deprecated)]
- pub fn send_file<F, R>(&self, file: R, filename: &str, f: F) -> Result<Message>
- where F: FnOnce(CreateMessage) -> CreateMessage, R: Read {
- self.id().send_file(file, filename, f)
- }
-
/// Sends (a) file(s) along with optional message contents.
///
/// Refer to [`ChannelId::send_files`] for examples and more information.
@@ -365,39 +303,6 @@ impl Channel {
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self.id().unpin(message_id)
}
-
- /// Alias of [`message`].
- ///
- /// [`message`]: #method.message
- #[deprecated(since="0.1.5", note="Use `message` instead.")]
- #[inline]
- pub fn get_message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
- self.message(message_id)
- }
-
- /// Alias of [`messages`].
- ///
- /// [`messages`]: #method.messages
- #[deprecated(since="0.1.5", note="Use `messages` instead.")]
- #[inline]
- pub fn get_messages<F>(&self, f: F) -> Result<Vec<Message>>
- where F: FnOnce(GetMessages) -> GetMessages {
- self.messages(f)
- }
-
- /// Alias of [`reaction_users`].
- ///
- /// [`reaction_users`]: #method.reaction_users
- #[deprecated(since="0.1.5", note="Use `reaction_users` instead.")]
- #[inline]
- pub fn get_reaction_users<M, R, U>(&self,
- message_id: M,
- reaction_type: R,
- limit: Option<u8>,
- after: Option<U>)
- -> Result<Vec<User>> where M: Into<MessageId>, R: Into<ReactionType>, U: Into<UserId> {
- self.reaction_users(message_id, reaction_type, limit, after)
- }
}
impl<'de> Deserialize<'de> for Channel {
diff --git a/src/model/channel/private_channel.rs b/src/model/channel/private_channel.rs
index c201c1c..b105d7e 100644
--- a/src/model/channel/private_channel.rs
+++ b/src/model/channel/private_channel.rs
@@ -224,37 +224,6 @@ impl PrivateChannel {
self.id.say(content)
}
- /// Sends a file along with optional message contents. The filename _must_
- /// be specified.
- ///
- /// Refer to [`ChannelId::send_file`] for examples and more information.
- ///
- /// The [Attach Files] and [Send Messages] permissions are required.
- ///
- /// **Note**: Message contents must be under 2000 unicode code points.
- ///
- /// # Errors
- ///
- /// Returns an
- /// [`HttpError::InvalidRequest(PayloadTooLarge)`][`HttpError::InvalidRequest`]
- /// if the file is too large to send.
- ///
- /// If the content of the message is over the above limit, then a
- /// [`ModelError::MessageTooLong`] will be returned, containing the number
- /// of unicode code points over the limit.
- ///
- /// [`ChannelId::send_file`]: struct.ChannelId.html#method.send_file
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
- #[deprecated(since="0.2.0", note="Please use `send_files` instead.")]
- #[allow(deprecated)]
- pub fn send_file<F, R>(&self, file: R, filename: &str, f: F) -> Result<Message>
- where F: FnOnce(CreateMessage) -> CreateMessage, R: Read {
- self.id.send_file(file, filename, f)
- }
-
/// Sends (a) file(s) along with optional message contents.
///
/// Refer to [`ChannelId::send_files`] for examples and more information.
@@ -308,39 +277,6 @@ impl PrivateChannel {
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self.id.unpin(message_id)
}
-
- /// Alias of [`message`].
- ///
- /// [`message`]: #method.message
- #[deprecated(since="0.1.5", note="Use `message` instead.")]
- #[inline]
- pub fn get_message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
- self.message(message_id)
- }
-
- /// Alias of [`messages`].
- ///
- /// [`messages`]: #method.messages
- #[deprecated(since="0.1.5", note="Use `messages` instead.")]
- #[inline]
- pub fn get_messages<F>(&self, f: F) -> Result<Vec<Message>>
- where F: FnOnce(GetMessages) -> GetMessages {
- self.messages(f)
- }
-
- /// Alias of [`reaction_users`].
- ///
- /// [`reaction_users`]: #method.reaction_users
- #[deprecated(since="0.1.5", note="Use `reaction_users` instead.")]
- #[inline]
- pub fn get_reaction_users<M, R, U>(&self,
- message_id: M,
- reaction_type: R,
- limit: Option<u8>,
- after: Option<U>)
- -> Result<Vec<User>> where M: Into<MessageId>, R: Into<ReactionType>, U: Into<UserId> {
- self.reaction_users(message_id, reaction_type, limit, after)
- }
}
impl Display for PrivateChannel {
diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs
index c707413..5d318a5 100644
--- a/src/model/guild/guild_id.rs
+++ b/src/model/guild/guild_id.rs
@@ -513,97 +513,6 @@ impl GuildId {
pub fn webhooks(&self) -> Result<Vec<Webhook>> {
http::get_guild_webhooks(self.0)
}
-
- /// Alias of [`bans`].
- ///
- /// [`bans`]: #method.bans
- #[deprecated(since="0.1.5", note="Use `bans` instead.")]
- #[inline]
- pub fn get_bans(&self) -> Result<Vec<Ban>> {
- self.bans()
- }
-
- /// Alias of [`channels`].
- ///
- /// [`channels`]: #method.channels
- #[deprecated(since="0.1.5", note="Use `channels` instead.")]
- #[inline]
- pub fn get_channels(&self) -> Result<HashMap<ChannelId, GuildChannel>> {
- self.channels()
- }
-
- /// Alias of [`emoji`].
- ///
- /// [`emoji`]: #method.emoji
- #[deprecated(since="0.1.5", note="Use `emoji` instead.")]
- #[inline]
- pub fn get_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<Emoji> {
- self.emoji(emoji_id)
- }
-
- /// Alias of [`emojis`].
- ///
- /// [`emojis`]: #method.emojis
- #[deprecated(since="0.1.5", note="Use `emojis` instead.")]
- #[inline]
- pub fn get_emojis(&self) -> Result<Vec<Emoji>> {
- self.emojis()
- }
-
- /// Alias of [`integrations`].
- ///
- /// [`integrations`]: #method.integrations
- #[deprecated(since="0.1.5", note="Use `integrations` instead.")]
- #[inline]
- pub fn get_integrations(&self) -> Result<Vec<Integration>> {
- self.integrations()
- }
-
- /// Alias of [`invites`].
- ///
- /// [`invites`]: #method.invites
- #[deprecated(since="0.1.5", note="Use `invites` instead.")]
- #[inline]
- pub fn get_invites(&self) -> Result<Vec<RichInvite>> {
- self.invites()
- }
-
- /// Alias of [`member`].
- ///
- /// [`member`]: #method.member
- #[deprecated(since="0.1.5", note="Use `member` instead.")]
- #[inline]
- pub fn get_member<U: Into<UserId>>(&self, user_id: U) -> Result<Member> {
- self.member(user_id)
- }
-
- /// Alias of [`members`].
- ///
- /// [`members`]: #method.members
- #[deprecated(since="0.1.5", note="Use `members` instead.")]
- #[inline]
- pub fn get_members<U>(&self, limit: Option<u64>, after: Option<U>)
- -> Result<Vec<Member>> where U: Into<UserId> {
- self.members(limit, after)
- }
-
- /// Alias of [`prune_count`].
- ///
- /// [`prune_count`]: #method.prune_count
- #[deprecated(since="0.1.5", note="Use `prune_count` instead.")]
- #[inline]
- pub fn get_prune_count(&self, days: u16) -> Result<GuildPrune> {
- self.prune_count(days)
- }
-
- /// Alias of [`webhooks`].
- ///
- /// [`webhooks`]: #method.webhooks
- #[deprecated(since="0.1.5", note="Use `webhooks` instead.")]
- #[inline]
- pub fn get_webhooks(&self) -> Result<Vec<Webhook>> {
- self.webhooks()
- }
}
impl Display for GuildId {
diff --git a/src/model/guild/member.rs b/src/model/guild/member.rs
index 053360d..2b382a0 100644
--- a/src/model/guild/member.rs
+++ b/src/model/guild/member.rs
@@ -206,14 +206,6 @@ impl Member {
http::edit_member(self.guild_id.0, self.user.read().unwrap().id.0, &map)
}
- /// Returns the value of [`guild_id`].
- ///
- /// [`guild_id`]: #structfield.guild_id
- #[deprecated(since="0.2.1", note="Use the `guild_id` structfield instead.")]
- pub fn find_guild(&self) -> Result<GuildId> {
- Ok(self.guild_id)
- }
-
/// Kick the member from the guild.
///
/// **Note**: Requires the [Kick Members] permission.
diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs
index 97eb3a4..fb91654 100644
--- a/src/model/guild/mod.rs
+++ b/src/model/guild/mod.rs
@@ -1008,106 +1008,6 @@ impl Guild {
pub fn webhooks(&self) -> Result<Vec<Webhook>> {
self.id.webhooks()
}
-
- /// Alias of [`bans`].
- ///
- /// [`bans`]: #method.bans
- #[deprecated(since="0.1.5", note="Use `bans` instead.")]
- #[inline]
- pub fn get_bans(&self) -> Result<Vec<Ban>> {
- self.bans()
- }
-
- /// Alias of [`channels`].
- ///
- /// [`channels`]: #method.channels
- #[deprecated(since="0.1.5", note="Use `channels` instead.")]
- #[inline]
- pub fn get_channels(&self) -> Result<HashMap<ChannelId, GuildChannel>> {
- self.channels()
- }
-
- /// Alias of [`emoji`].
- ///
- /// [`emoji`]: #method.emoji
- #[deprecated(since="0.1.5", note="Use `emoji` instead.")]
- #[inline]
- pub fn get_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<Emoji> {
- self.emoji(emoji_id)
- }
-
- /// Alias of [`emojis`].
- ///
- /// [`emojis`]: #method.emojis
- #[deprecated(since="0.1.5", note="Use `emojis` instead.")]
- #[inline]
- pub fn get_emojis(&self) -> Result<Vec<Emoji>> {
- self.emojis()
- }
-
- /// Alias of [`integrations`].
- ///
- /// [`integrations`]: #method.integrations
- #[deprecated(since="0.1.5", note="Use `integrations` instead.")]
- #[inline]
- pub fn get_integrations(&self) -> Result<Vec<Integration>> {
- self.integrations()
- }
-
- /// Alias of [`invites`].
- ///
- /// [`invites`]: #method.invites
- #[deprecated(since="0.1.5", note="Use `invites` instead.")]
- #[inline]
- pub fn get_invites(&self) -> Result<Vec<RichInvite>> {
- self.invites()
- }
-
- /// Alias of [`member`].
- ///
- /// [`member`]: #method.member
- #[deprecated(since="0.1.5", note="Use `member` instead.")]
- #[inline]
- pub fn get_member<U: Into<UserId>>(&self, user_id: U) -> Result<Member> {
- self.member(user_id)
- }
-
- /// Alias of [`members`].
- ///
- /// [`members`]: #method.members
- #[deprecated(since="0.1.5", note="Use `members` instead.")]
- #[inline]
- pub fn get_members<U>(&self, limit: Option<u64>, after: Option<U>)
- -> Result<Vec<Member>> where U: Into<UserId> {
- self.members(limit, after)
- }
-
- /// Alias of [`member_named`].
- ///
- /// [`member_named`]: #method.member_named
- #[deprecated(since="0.1.5", note="Use `member_named` instead.")]
- #[inline]
- pub fn get_member_named(&self, name: &str) -> Option<&Member> {
- self.member_named(name)
- }
-
- /// Alias of [`prune_count`].
- ///
- /// [`prune_count`]: #method.prune_count
- #[deprecated(since="0.1.5", note="Use `prune_count` instead.")]
- #[inline]
- pub fn get_prune_count(&self, days: u16) -> Result<GuildPrune> {
- self.prune_count(days)
- }
-
- /// Alias of [`webhooks`].
- ///
- /// [`webhooks`]: #method.webhooks
- #[deprecated(since="0.1.5", note="Use `webhooks` instead.")]
- #[inline]
- pub fn get_webhooks(&self) -> Result<Vec<Webhook>> {
- self.webhooks()
- }
}
impl<'de> Deserialize<'de> for Guild {
diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs
index 694a64b..26d4257 100644
--- a/src/model/guild/partial_guild.rs
+++ b/src/model/guild/partial_guild.rs
@@ -477,95 +477,4 @@ impl PartialGuild {
pub fn webhooks(&self) -> Result<Vec<Webhook>> {
self.id.webhooks()
}
-
- /// Alias of [`bans`].
- ///
- /// [`bans`]: #method.bans
- #[deprecated(since="0.1.5", note="Use `bans` instead.")]
- #[inline]
- pub fn get_bans(&self) -> Result<Vec<Ban>> {
- self.bans()
- }
-
- /// Alias of [`channels`].
- ///
- /// [`channels`]: #method.channels
- #[deprecated(since="0.1.5", note="Use `channels` instead.")]
- #[inline]
- pub fn get_channels(&self) -> Result<HashMap<ChannelId, GuildChannel>> {
- self.channels()
- }
-
- /// Alias of [`emoji`].
- ///
- /// [`emoji`]: #method.emoji
- #[deprecated(since="0.1.5", note="Use `emoji` instead.")]
- #[inline]
- pub fn get_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<Emoji> {
- self.emoji(emoji_id)
- }
-
- /// Alias of [`emojis`].
- ///
- /// [`emojis`]: #method.emojis
- #[deprecated(since="0.1.5", note="Use `emojis` instead.")]
- #[inline]
- pub fn get_emojis(&self) -> Result<Vec<Emoji>> {
- self.emojis()
- }
-
- /// Alias of [`integrations`].
- ///
- /// [`integrations`]: #method.integrations
- #[deprecated(since="0.1.5", note="Use `integrations` instead.")]
- #[inline]
- pub fn get_integrations(&self) -> Result<Vec<Integration>> {
- self.integrations()
- }
-
- /// Alias of [`invites`].
- ///
- /// [`invites`]: #method.invites
- #[deprecated(since="0.1.5", note="Use `invites` instead.")]
- #[inline]
- pub fn get_invites(&self) -> Result<Vec<RichInvite>> {
- self.invites()
- }
-
- /// Alias of [`member`].
- ///
- /// [`member`]: #method.member
- #[deprecated(since="0.1.5", note="Use `member` instead.")]
- #[inline]
- pub fn get_member<U: Into<UserId>>(&self, user_id: U) -> Result<Member> {
- self.member(user_id)
- }
-
- /// Alias of [`members`].
- ///
- /// [`members`]: #method.members
- #[deprecated(since="0.1.5", note="Use `members` instead.")]
- #[inline]
- pub fn get_members<U>(&self, limit: Option<u64>, after: Option<U>)
- -> Result<Vec<Member>> where U: Into<UserId> {
- self.members(limit, after)
- }
-
- /// Alias of [`prune_count`].
- ///
- /// [`prune_count`]: #method.prune_count
- #[deprecated(since="0.1.5", note="Use `prune_count` instead.")]
- #[inline]
- pub fn get_prune_count(&self, days: u16) -> Result<GuildPrune> {
- self.prune_count(days)
- }
-
- /// Alias of [`webhooks`].
- ///
- /// [`webhooks`]: #method.webhooks
- #[deprecated(since="0.1.5", note="Use `webhooks` instead.")]
- #[inline]
- pub fn get_webhooks(&self) -> Result<Vec<Webhook>> {
- self.webhooks()
- }
}
diff --git a/src/model/guild/role.rs b/src/model/guild/role.rs
index 8383675..bed641b 100644
--- a/src/model/guild/role.rs
+++ b/src/model/guild/role.rs
@@ -101,15 +101,6 @@ impl Role {
}
}
- /// Alias of [`edit`]
- ///
- /// [`edit`]: struct.Role.html#method.edit
- #[deprecated(since="0.2.1", note="Please use `edit` instead.")]
- #[cfg(all(feature="builder", feature="cache"))]
- pub fn edit_role<F: FnOnce(EditRole) -> EditRole>(&self, f: F) -> Result<Role> {
- self.edit(f)
- }
-
/// Searches the cache for the guild that owns the role.
///
/// # Errors
diff --git a/src/model/permissions.rs b/src/model/permissions.rs
index 40e75ce..3968e16 100644
--- a/src/model/permissions.rs
+++ b/src/model/permissions.rs
@@ -146,33 +146,6 @@ pub const PRESET_VOICE: Permissions = Permissions {
bits: 0b00000011111100000000000000000000,
};
-/// Alias of [`PRESET_GENERAL`].
-///
-/// [`PRESET_GENERAL`]: const.PRESET_GENERAL.html
-#[deprecated(since="0.1.5", note="Use `permissions::PRESET_GENERAL` instead")]
-#[inline(always)]
-pub fn general() -> Permissions {
- PRESET_GENERAL
-}
-
-/// Alias of [`PRESET_TEXT`].
-///
-/// [`PRESET_TEXT`]: const.PRESET_TEXT.html
-#[deprecated(since="0.1.5", note="Use `permissions::PRESET_TEXT` instead")]
-#[inline(always)]
-pub fn text() -> Permissions {
- PRESET_TEXT
-}
-
-/// Alias of [`PRESET_VOICE`].
-///
-/// [`PRESET_VOICE`]: const.PRESET_VOICE.html
-#[deprecated(since="0.1.5", note="Use `permissions::PRESET_VOICE` instead")]
-#[inline(always)]
-pub fn voice() -> Permissions {
- PRESET_VOICE
-}
-
bitflags! {
/// A set of permissions that can be assigned to [`User`]s and [`Role`]s via
/// [`PermissionOverwrite`]s, roles globally in a [`Guild`], and to
diff --git a/src/model/user.rs b/src/model/user.rs
index 9c248ba..e447519 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -72,15 +72,6 @@ impl CurrentUser {
default_avatar_url(self.discriminator)
}
- /// Alias of [`tag`].
- ///
- /// [`tag`]: #method.tag
- #[deprecated(since="0.2.0", note="Use `tag` instead.")]
- #[inline]
- pub fn distinct(&self) -> String {
- self.tag()
- }
-
/// Edits the current user's profile settings.
///
/// This mutates the current user in-place.
@@ -540,15 +531,6 @@ impl User {
private_channel_id.send_message(f)
}
- /// Alias of [`tag`].
- ///
- /// [`tag`]: #method.tag
- #[deprecated(since="0.2.0", note="Use `tag` instead.")]
- #[inline]
- pub fn distinct(&self) -> String {
- self.tag()
- }
-
/// This is an alias of [direct_message].
///
/// # Examples
@@ -586,23 +568,6 @@ impl User {
self.avatar_url().unwrap_or_else(|| self.default_avatar_url())
}
- /// Gets a user by its Id over the REST API.
- ///
- /// **Note**: The current user must be a bot user.
- ///
- /// # Errors
- ///
- /// If the `cache` is enabled, returns a
- /// [`ModelError::InvalidOperationAsUser`] if the current user is not a bot
- /// user.
- ///
- /// [`ModelError::InvalidOperationAsUser`]: enum.ModelError.html#variant.InvalidOperationAsUser
- #[deprecated(since="0.2.0", note="Don't use this, since it doesn't fit serenity's design.")]
- #[inline]
- pub fn get<U: Into<UserId>>(user_id: U) -> Result<User> {
- user_id.into().get()
- }
-
/// Check if a user has a [`Role`]. This will retrieve the [`Guild`] from
/// the [`Cache`] if it is available, and then check if that guild has the
/// given [`Role`].