From 94131908f00a8cbb714f3a93066e2a83dfc1c5b3 Mon Sep 17 00:00:00 2001 From: Austin Hellyer Date: Tue, 24 Jan 2017 12:07:41 -0800 Subject: Fix docs links --- src/model/channel.rs | 52 ++++++++++++++++++++++++++++------------------------ src/model/guild.rs | 31 ++++++++++++++++--------------- src/model/invite.rs | 1 + src/model/mod.rs | 2 ++ 4 files changed, 47 insertions(+), 39 deletions(-) (limited to 'src/model') diff --git a/src/model/channel.rs b/src/model/channel.rs index 42d5d08..753b42f 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -135,7 +135,7 @@ impl Channel { /// [`Channel`]: enum.Channel.html /// [`ClientError::InvalidOperationAsBot`]: ../client/enum.ClientError.html#variant.InvalidOperationAsUser /// [`Message`]: struct.Message.html - /// [`rest::ack_message`]: rest/fn.ack_message.html + /// [`rest::ack_message`]: ../client/rest/fn.ack_message.html pub fn ack>(&self, message_id: M) -> Result<()> { #[cfg(feature="cache")] { @@ -265,7 +265,7 @@ impl Channel { /// /// Requires the [Read Message History] permission. /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_message>(&self, message_id: M) -> Result { self.id().get_message(message_id) @@ -285,7 +285,7 @@ impl Channel { /// .after(100)); // Maximum is 100. /// ``` /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_messages(&self, f: F) -> Result> where F: FnOnce(GetMessages) -> GetMessages { @@ -446,7 +446,7 @@ impl ChannelId { /// /// [`GuildChannel::create_permission`]: struct.GuildChannel.html#method.create_permission /// [`Member`]: struct.Member.html - /// [`PermissionOverwrite`]: struct.PermissionOverWrite.html + /// [`PermissionOverwrite`]: struct.PermissionOverwrite.html /// [`Role`]: struct.Role.html /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html pub fn create_permission(&self, target: PermissionOverwrite) @@ -497,8 +497,6 @@ impl ChannelId { /// Requires the [Manage Messages] permission, if the current user is not /// the author of the message. /// - /// (in practice, please do not do this) - /// /// [`Message`]: struct.Message.html /// [`Message::delete`]: struct.Message.html#method.delete /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html @@ -582,6 +580,7 @@ impl ChannelId { /// /// [`Channel`]: enum.Channel.html /// [`ClientError::NoChannelId`]: ../client/enum.ClientError.html#variant.NoChannelId + /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html #[inline] pub fn edit EditChannel>(&self, f: F) -> Result { rest::edit_channel(self.0, f(EditChannel::default()).0.build()) @@ -646,7 +645,7 @@ impl ChannelId { /// /// Requires the [Read Message History] permission. /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_message>(&self, message_id: M) -> Result { rest::get_message(self.0, message_id.into().0) @@ -659,7 +658,7 @@ impl ChannelId { /// Requires the [Read Message History] permission. /// /// [`Channel::get_messages`]: enum.Channel.html#method.get_messages - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html pub fn get_messages(&self, f: F) -> Result> where F: FnOnce(GetMessages) -> GetMessages { let mut map = f(GetMessages::default()).0; @@ -714,12 +713,16 @@ impl ChannelId { } /// Pins a [`Message`] to the channel. + /// + /// [`Message`]: struct.Message.html #[inline] pub fn pin>(&self, message_id: M) -> Result<()> { rest::pin_message(self.0, message_id.into().0) } /// Gets the list of [`Message`]s which are pinned to the channel. + /// + /// [`Message`]: struct.Message.html #[inline] pub fn pins(&self) -> Result> { rest::get_pins(self.0) @@ -888,7 +891,7 @@ impl Group { /// /// [`ClientError::InvalidOperationAsBot`]: ../client/enum.ClientError.html#variant.InvalidOperationAsUser /// [`Message`]: struct.Message.html - /// [`rest::ack_message`]: rest/fn.ack_message.html + /// [`rest::ack_message`]: ../client/rest/fn.ack_message.html pub fn ack>(&self, message_id: M) -> Result<()> { #[cfg(feature="cache")] { @@ -991,7 +994,7 @@ impl Group { /// /// Requires the [Read Message History] permission. /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_message>(&self, message_id: M) -> Result { self.channel_id.get_message(message_id) @@ -1001,7 +1004,7 @@ impl Group { /// /// Requires the [Read Message History] permission. /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_messages(&self, f: F) -> Result> where F: FnOnce(GetMessages) -> GetMessages { @@ -1110,7 +1113,7 @@ impl Group { /// Sends a message to the group with the given content. /// - /// Note that an @everyone mention will not be applied. + /// Note that an `@everyone` mention will not be applied. /// /// **Note**: Requires the [Send Messages] permission. /// @@ -1147,7 +1150,7 @@ impl Message { /// [`Channel`]: enum.Channel.html /// [`ClientError::InvalidOperationAsBot`]: ../client/enum.ClientError.html#variant.InvalidOperationAsUser /// [`Message`]: struct.Message.html - /// [`rest::ack_message`]: rest/fn.ack_message.html + /// [`rest::ack_message`]: ../client/rest/fn.ack_message.html pub fn ack>(&self) -> Result<()> { #[cfg(feature="cache")] { @@ -1562,7 +1565,7 @@ impl PrivateChannel { /// /// [`ClientError::InvalidOperationAsBot`]: ../client/enum.ClientError.html#variant.InvalidOperationAsUser /// [`Message`]: struct.Message.html - /// [`rest::ack_message`]: rest/fn.ack_message.html + /// [`rest::ack_message`]: ../client/rest/fn.ack_message.html pub fn ack>(&self, message_id: M) -> Result<()> { #[cfg(feature="cache")] { @@ -1666,7 +1669,7 @@ impl PrivateChannel { /// /// Requires the [Read Message History] permission. /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_message>(&self, message_id: M) -> Result { self.id.get_message(message_id) @@ -1679,7 +1682,7 @@ impl PrivateChannel { /// Requires the [Read Message History] permission. /// /// [`Channel::get_messages`]: enum.Channel.html#method.get_messages - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_messages(&self, f: F) -> Result> where F: FnOnce(GetMessages) -> GetMessages { @@ -1709,6 +1712,8 @@ impl PrivateChannel { } /// Pins a [`Message`] to the channel. + /// + /// [`Message`]: struct.Message.html #[inline] pub fn pin>(&self, message_id: M) -> Result<()> { self.id.pin(message_id) @@ -1800,7 +1805,7 @@ impl GuildChannel { /// /// [`ClientError::InvalidOperationAsBot`]: ../client/enum.ClientError.html#variant.InvalidOperationAsUser /// [`Message`]: struct.Message.html - /// [`rest::ack_message`]: rest/fn.ack_message.html + /// [`rest::ack_message`]: ../client/rest/fn.ack_message.html pub fn ack>(&self, message_id: M) -> Result<()> { #[cfg(feature="cache")] { @@ -1820,12 +1825,11 @@ impl GuildChannel { /// /// # Errors /// - /// Returns a - /// [`ClientError::InvalidPermissions`] if the current user does not have the - /// required permissions. + /// Returns a [`ClientError::InvalidPermissions`] if the current user does + /// not have the required permissions. /// /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions - /// [Send Messages]: permissions/constants.SEND_MESSAGES.html + /// [Send Messages]: permissions/constant.SEND_MESSAGES.html pub fn broadcast_typing(&self) -> Result<()> { self.id.broadcast_typing() } @@ -1916,7 +1920,7 @@ impl GuildChannel { /// /// [`Channel`]: enum.Channel.html /// [`Member`]: struct.Member.html - /// [`PermissionOverwrite`]: struct.PermissionOverWrite.html + /// [`PermissionOverwrite`]: struct.PermissionOverwrite.html /// [`PermissionOverwrite::Member`]: struct.PermissionOverwrite.html#variant.Member /// [`Role`]: struct.Role.html /// [Attach Files]: permissions/constant.ATTACH_FILES.html @@ -2068,7 +2072,7 @@ impl GuildChannel { /// /// Requires the [Read Message History] permission. /// - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_message>(&self, message_id: M) -> Result { self.id.get_message(message_id) @@ -2081,7 +2085,7 @@ impl GuildChannel { /// Requires the [Read Message History] permission. /// /// [`Channel::get_messages`]: enum.Channel.html#method.get_messages - /// [Read Message History]: permission/constant.READ_MESSAGE_HISTORY.html + /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html #[inline] pub fn get_messages(&self, f: F) -> Result> where F: FnOnce(GetMessages) -> GetMessages { diff --git a/src/model/guild.rs b/src/model/guild.rs index 0955ce6..5d3d0fd 100644 --- a/src/model/guild.rs +++ b/src/model/guild.rs @@ -261,7 +261,7 @@ impl Guild { /// /// [`Guild`]: struct.Guild.html /// [`PartialGuild`]: struct.PartialGuild.html - /// [`Shard`]: ../gateway/struct.Shard.html + /// [`Shard`]: ../client/gateway/struct.Shard.html /// [US West region]: enum.Region.html#variant.UsWest /// [whitelist]: https://discordapp.com/developers/docs/resources/guild#create-guild pub fn create(name: &str, region: Region, icon: Option<&str>) -> Result { @@ -295,7 +295,7 @@ impl Guild { /// /// [`Channel`]: struct.Channel.html /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions - /// [Manage Channels]: permissions/constants.MANAGE_CHANNELS.html + /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html pub fn create_channel(&mut self, name: &str, kind: ChannelType) -> Result { #[cfg(feature="cache")] { @@ -366,7 +366,7 @@ impl Guild { /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions /// [`Context::create_role`]: ../client/struct.Context.html#method.create_role /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constants.MANAGE_ROLES.html + /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html pub fn create_role(&self, f: F) -> Result where F: FnOnce(EditRole) -> EditRole { #[cfg(feature="cache")] @@ -489,8 +489,6 @@ impl Guild { /// /// Refer to `EditGuild`'s documentation for a full list of methods. /// - /// Also see [`Guild::edit`] if you have the `methods` feature enabled. - /// /// **Note**: Requires the current user to have the [Manage Guild] /// permission. /// @@ -515,7 +513,7 @@ impl Guild { /// /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions /// [`Context::edit_guild`]: ../client/struct.Context.html#method.edit_guild - /// [Manage Guild]: permissions/constants.MANAGE_GUILD.html + /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html pub fn edit(&mut self, f: F) -> Result<()> where F: FnOnce(EditGuild) -> EditGuild { #[cfg(feature="cache")] @@ -1170,7 +1168,7 @@ impl GuildId { /// ``` /// /// [`GuildChannel`]: struct.GuildChannel.html - /// [`rest::create_channel`]: rest/fn.create_channel.html + /// [`rest::create_channel`]: ../client/rest/fn.create_channel.html /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html pub fn create_channel(&self, name: &str, kind: ChannelType) -> Result { let map = ObjectBuilder::new() @@ -1230,7 +1228,7 @@ impl GuildId { /// **Note**: Requires the [Manage Roles] permission. /// /// [`Guild::create_role`]: struct.Guild.html#method.create_role - /// [Manage Roles]: permissions/constants.MANAGE_ROLES.html + /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html #[inline] pub fn create_role EditRole>(&self, f: F) -> Result { rest::create_role(self.0, f(EditRole::default()).0.build()) @@ -1293,7 +1291,7 @@ impl GuildId { /// permission. /// /// [`Guild::edit`]: struct.Guild.html#method.edit - /// [Manage Guild]: permissions/constants.MANAGE_GUILD.html + /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html #[inline] pub fn edit EditGuild>(&mut self, f: F) -> Result { rest::edit_guild(self.0, f(EditGuild::default()).0.build()) @@ -1388,6 +1386,8 @@ impl GuildId { /// Gets a list of the guild's bans. /// /// Requires the [Ban Members] permission. + /// + /// [Ban Members]: permissions/constant.BAN_MEMBERS.html #[inline] pub fn get_bans(&self) -> Result> { rest::get_bans(self.0) @@ -1551,6 +1551,7 @@ impl GuildId { /// /// [`Guild::search_channels`]: struct.Guild.html#method.search_channels /// [`Message`]: struct.Message.html + /// [`Search`]: ../utils/builder/struct.Search.html pub fn search_channels(&self, channel_ids: &[ChannelId], f: F) -> Result where F: FnOnce(Search) -> Search { let ids = channel_ids.iter().map(|x| x.0).collect::>(); @@ -1942,7 +1943,7 @@ impl PartialGuild { /// ``` /// /// [`GuildChannel`]: struct.GuildChannel.html - /// [`rest::create_channel`]: rest/fn.create_channel.html + /// [`rest::create_channel`]: ../client/rest/fn.create_channel.html /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html #[inline] pub fn create_channel(&self, name: &str, kind: ChannelType) -> Result { @@ -1995,7 +1996,7 @@ impl PartialGuild { /// /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions /// [`Guild::create_role`]: struct.Guild.html#method.create_role - /// [Manage Roles]: permissions/constants.MANAGE_ROLES.html + /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html #[inline] pub fn create_role EditRole>(&self, f: F) -> Result { self.id.create_role(f) @@ -2048,13 +2049,11 @@ impl PartialGuild { /// Edits the current guild with new data where specified. /// - /// Refer to [`Guild::edit`] for more information. - /// /// **Note**: Requires the current user to have the [Manage Guild] /// permission. /// /// [`Context::edit_guild`]: ../client/struct.Context.html#method.edit_guild - /// [Manage Guild]: permissions/constants.MANAGE_GUILD.html + /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html pub fn edit(&mut self, f: F) -> Result<()> where F: FnOnce(EditGuild) -> EditGuild { match self.id.edit(f) { @@ -2147,6 +2146,8 @@ impl PartialGuild { /// Gets a list of the guild's bans. /// /// Requires the [Ban Members] permission. + /// + /// [Ban Members]: permissions/constant.BAN_MEMBERS.html #[inline] pub fn get_bans(&self) -> Result> { self.id.get_bans() @@ -2192,7 +2193,7 @@ impl PartialGuild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/struct.MANAGE_GUILD.html + /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html #[inline] pub fn get_invites(&self) -> Result> { self.id.get_invites() diff --git a/src/model/invite.rs b/src/model/invite.rs index 47ae28a..10227bc 100644 --- a/src/model/invite.rs +++ b/src/model/invite.rs @@ -57,6 +57,7 @@ impl Invite { /// If the `cache` is enabled, returns a [`ClientError::InvalidPermissions`] /// if the current user does not have the required [permission]. /// + /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions /// [`CreateInvite`]: ../utils/builder/struct.CreateInvite.html /// [`GuildChannel`]: struct.GuildChannel.html /// [Create Invite]: permissions/constant.CREATE_INVITE.html diff --git a/src/model/mod.rs b/src/model/mod.rs index c2883ce..2a4f97d 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -132,6 +132,8 @@ pub enum Channel { Guild(GuildChannel), /// A private channel to another [`User`]. No other users may access the /// channel. For multi-user "private channels", use a group. + /// + /// [`User`]: struct.User.html Private(PrivateChannel), } -- cgit v1.2.3