diff options
| author | mei <[email protected]> | 2017-06-27 20:37:30 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2017-06-27 20:37:59 -0700 |
| commit | f05efce7af0cb7020e7da08c7ca58fa6f786d4ef (patch) | |
| tree | f421e905cb9c49c695b7ff2aa0468ddb810e537d /src/model | |
| parent | Add missing ModelError variant in description impl (diff) | |
| download | serenity-f05efce7af0cb7020e7da08c7ca58fa6f786d4ef.tar.xz serenity-f05efce7af0cb7020e7da08c7ca58fa6f786d4ef.zip | |
Docs fixes
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel/channel_id.rs | 8 | ||||
| -rw-r--r-- | src/model/channel/group.rs | 4 | ||||
| -rw-r--r-- | src/model/channel/guild_channel.rs | 12 | ||||
| -rw-r--r-- | src/model/channel/message.rs | 2 | ||||
| -rw-r--r-- | src/model/channel/mod.rs | 2 | ||||
| -rw-r--r-- | src/model/channel/private_channel.rs | 8 | ||||
| -rw-r--r-- | src/model/guild/member.rs | 4 | ||||
| -rw-r--r-- | src/model/guild/mod.rs | 2 | ||||
| -rw-r--r-- | src/model/guild/partial_guild.rs | 1 | ||||
| -rw-r--r-- | src/model/mod.rs | 9 |
10 files changed, 20 insertions, 32 deletions
diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs index bb9932d..4cfd06c 100644 --- a/src/model/channel/channel_id.rs +++ b/src/model/channel/channel_id.rs @@ -264,11 +264,11 @@ impl ChannelId { /// Gets messages from the channel. /// - /// Refer to [`Channel::get_messages`] for more information. + /// Refer to [`Channel::messages`] for more information. /// /// Requires the [Read Message History] permission. /// - /// [`Channel::get_messages`]: enum.Channel.html#method.get_messages + /// [`Channel::messages`]: enum.Channel.html#method.messages /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html pub fn messages<F>(&self, f: F) -> Result<Vec<Message>> where F: FnOnce(GetMessages) -> GetMessages { @@ -312,11 +312,11 @@ impl ChannelId { /// Gets the list of [`User`]s who have reacted to a [`Message`] with a /// certain [`Emoji`]. /// - /// Refer to [`Channel::get_reaction_users`] for more information. + /// Refer to [`Channel::reaction_users`] for more information. /// /// **Note**: Requires the [Read Message History] permission. /// - /// [`Channel::get_reaction_users`]: enum.Channel.html#variant.get_reaction_users + /// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users /// [`Emoji`]: struct.Emoji.html /// [`Message`]: struct.Message.html /// [`User`]: struct.User.html diff --git a/src/model/channel/group.rs b/src/model/channel/group.rs index 63efb90..8bb4e2c 100644 --- a/src/model/channel/group.rs +++ b/src/model/channel/group.rs @@ -229,11 +229,11 @@ impl Group { /// Gets the list of [`User`]s who have reacted to a [`Message`] with a /// certain [`Emoji`]. /// - /// Refer to [`Channel::get_reaction_users`] for more information. + /// Refer to [`Channel::reaction_users`] for more information. /// /// **Note**: Requires the [Read Message History] permission. /// - /// [`Channel::get_reaction_users`]: enum.Channel.html#variant.get_reaction_users + /// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users /// [`Emoji`]: struct.Emoji.html /// [`Message`]: struct.Message.html /// [`User`]: struct.User.html diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs index 4f47d28..09e76a4 100644 --- a/src/model/channel/guild_channel.rs +++ b/src/model/channel/guild_channel.rs @@ -390,11 +390,11 @@ impl GuildChannel { /// Gets messages from the channel. /// - /// Refer to [`Channel::get_messages`] for more information. + /// Refer to [`Channel::messages`] for more information. /// /// Requires the [Read Message History] permission. /// - /// [`Channel::get_messages`]: enum.Channel.html#method.get_messages + /// [`Channel::messages`]: enum.Channel.html#method.messages /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn messages<F>(&self, f: F) -> Result<Vec<Message>> @@ -420,7 +420,7 @@ impl GuildChannel { /// use serenity::CACHE; /// /// client.on_message(|_, msg| { - /// let channel = match CACHE.read().unwrap().get_guild_channel(msg.channel_id) { + /// let channel = match CACHE.read().unwrap().guild_channel(msg.channel_id) { /// Some(channel) => channel, /// None => return, /// }; @@ -445,7 +445,7 @@ impl GuildChannel { /// use std::fs::File; /// /// client.on_message(|_, msg| { - /// let channel = match CACHE.read().unwrap().get_guild_channel(msg.channel_id) { + /// let channel = match CACHE.read().unwrap().guild_channel(msg.channel_id) { /// Some(channel) => channel, /// None => return, /// }; @@ -505,11 +505,11 @@ impl GuildChannel { /// Gets the list of [`User`]s who have reacted to a [`Message`] with a /// certain [`Emoji`]. /// - /// Refer to [`Channel::get_reaction_users`] for more information. + /// Refer to [`Channel::reaction_users`] for more information. /// /// **Note**: Requires the [Read Message History] permission. /// - /// [`Channel::get_reaction_users`]: enum.Channel.html#variant.get_reaction_users + /// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users /// [`Emoji`]: struct.Emoji.html /// [`Message`]: struct.Message.html /// [`User`]: struct.User.html diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index 89973d0..3fa9de4 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -22,7 +22,7 @@ pub struct Message { /// The unique Id of the message. Can be used to calculate the creation date /// of the message. pub id: MessageId, - /// An array of the files attached to a message. + /// An vector of the files attached to a message. pub attachments: Vec<Attachment>, /// The user that sent the message. pub author: User, diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs index 876f5dd..730410e 100644 --- a/src/model/channel/mod.rs +++ b/src/model/channel/mod.rs @@ -210,7 +210,7 @@ impl Channel { /// let id = MessageId(81392407232380928); /// /// // Maximum is 100. - /// let _messages = channel.get_messages(|g| g.after(id).limit(100)); + /// let _messages = channel.messages(|g| g.after(id).limit(100)); /// ``` /// /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html diff --git a/src/model/channel/private_channel.rs b/src/model/channel/private_channel.rs index 797ba94..c201c1c 100644 --- a/src/model/channel/private_channel.rs +++ b/src/model/channel/private_channel.rs @@ -160,11 +160,11 @@ impl PrivateChannel { /// Gets messages from the channel. /// - /// Refer to [`Channel::get_messages`] for more information. + /// Refer to [`Channel::messages`] for more information. /// /// Requires the [Read Message History] permission. /// - /// [`Channel::get_messages`]: enum.Channel.html#method.get_messages + /// [`Channel::messages`]: enum.Channel.html#method.messages /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn messages<F>(&self, f: F) -> Result<Vec<Message>> @@ -175,11 +175,11 @@ impl PrivateChannel { /// Gets the list of [`User`]s who have reacted to a [`Message`] with a /// certain [`Emoji`]. /// - /// Refer to [`Channel::get_reaction_users`] for more information. + /// Refer to [`Channel::reaction_users`] for more information. /// /// **Note**: Requires the [Read Message History] permission. /// - /// [`Channel::get_reaction_users`]: enum.Channel.html#variant.get_reaction_users + /// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users /// [`Emoji`]: struct.Emoji.html /// [`Message`]: struct.Message.html /// [`User`]: struct.User.html diff --git a/src/model/guild/member.rs b/src/model/guild/member.rs index a993706..8ef82a6 100644 --- a/src/model/guild/member.rs +++ b/src/model/guild/member.rs @@ -142,13 +142,13 @@ impl Member { format!("{}#{}", self.display_name(), self.user.read().unwrap().discriminator) } - /// Edits the member with the given data. See [`Context::edit_member`] for + /// Edits the member with the given data. See [`Guild::edit_member`] for /// more information. /// /// See [`EditMember`] for the permission(s) required for separate builder /// methods, as well as usage of this. /// - /// [`Context::edit_member`]: ../client/struct.Context.html#method.edit_member + /// [`Guild::edit_member`]: ../model/struct.Guild.html#method.edit_member /// [`EditMember`]: ../builder/struct.EditMember.html #[cfg(feature="cache")] pub fn edit<F: FnOnce(EditMember) -> EditMember>(&self, f: F) -> Result<()> { diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index fced129..5c664f7 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -342,7 +342,6 @@ impl Guild { /// if the current user does not have permission to perform bans. /// /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [`Context::create_role`]: ../client/struct.Context.html#method.create_role /// [`Role`]: struct.Role.html /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html pub fn create_role<F>(&self, f: F) -> Result<Role> @@ -446,7 +445,6 @@ impl Guild { /// if the current user does not have permission to perform bans. /// /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [`Context::edit_guild`]: ../client/struct.Context.html#method.edit_guild /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html pub fn edit<F>(&mut self, f: F) -> Result<()> where F: FnOnce(EditGuild) -> EditGuild { diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index 780a6ca..694a64b 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -207,7 +207,6 @@ impl PartialGuild { /// **Note**: Requires the current user to have the [Manage Guild] /// permission. /// - /// [`Context::edit_guild`]: ../client/struct.Context.html#method.edit_guild /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html pub fn edit<F>(&mut self, f: F) -> Result<()> where F: FnOnce(EditGuild) -> EditGuild { diff --git a/src/model/mod.rs b/src/model/mod.rs index 21348b9..92e533e 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -3,15 +3,6 @@ //! //! Models can optionally have additional helper methods compiled, by enabling //! the `model` feature. -//! -//! Methods like [`Message::delete`] or [`Webhook::execute`] are provided with -//! this feature, which can be shorthands for operations that are otherwise in -//! the [`Context`], or the much lower-level [`http`] module. -//! -//! [`Context`]: ../client/struct.Context.html -//! [`Message::delete`]: struct.Message.html#method.delete -//! [`Webhook::execute`]: struct.Webhook.html#method.execute -//! [`http`]: ../http/index.html #[macro_use] mod utils; |