diff options
| author | Erk- <[email protected]> | 2018-08-09 20:34:33 +0200 |
|---|---|---|
| committer | zeyla <[email protected]> | 2018-08-09 11:34:33 -0700 |
| commit | 40053a71931bb63c43eb6f469ee3c94383c9e90a (patch) | |
| tree | 79c2fabc1229d0543205bc6daf8ebebc6ebc9755 /src/model/guild | |
| parent | [routing] Fix various incorrect routes. (#364) (diff) | |
| download | serenity-40053a71931bb63c43eb6f469ee3c94383c9e90a.tar.xz serenity-40053a71931bb63c43eb6f469ee3c94383c9e90a.zip | |
Fix all the dead links in the docs
Diffstat (limited to 'src/model/guild')
| -rw-r--r-- | src/model/guild/emoji.rs | 5 | ||||
| -rw-r--r-- | src/model/guild/guild_id.rs | 103 | ||||
| -rw-r--r-- | src/model/guild/member.rs | 35 | ||||
| -rw-r--r-- | src/model/guild/mod.rs | 107 | ||||
| -rw-r--r-- | src/model/guild/partial_guild.rs | 64 | ||||
| -rw-r--r-- | src/model/guild/role.rs | 8 |
6 files changed, 159 insertions, 163 deletions
diff --git a/src/model/guild/emoji.rs b/src/model/guild/emoji.rs index e787e46..51c660f 100644 --- a/src/model/guild/emoji.rs +++ b/src/model/guild/emoji.rs @@ -52,7 +52,8 @@ impl Emoji { /// /// **Note**: Only user accounts may use this method. /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [Manage Emojis]: + /// ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS /// /// # Examples /// @@ -91,7 +92,7 @@ impl Emoji { /// /// **Note**: Only user accounts may use this method. /// - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS /// /// # Examples /// diff --git a/src/model/guild/guild_id.rs b/src/model/guild/guild_id.rs index ebe930e..4b2bd21 100644 --- a/src/model/guild/guild_id.rs +++ b/src/model/guild/guild_id.rs @@ -43,11 +43,10 @@ impl GuildId { /// Returns a [`ModelError::DeleteMessageDaysAmount`] if the number of /// days' worth of messages to delete is over the maximum. /// - /// [`ModelError::DeleteMessageDaysAmount`]: - /// enum.ModelError.html#variant.DeleteMessageDaysAmount - /// [`Guild::ban`]: struct.Guild.html#method.ban - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::DeleteMessageDaysAmount`]: ../error/enum.Error.html#variant.DeleteMessageDaysAmount + /// [`Guild::ban`]: ../guild/struct.Guild.html#method.ban + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[inline] pub fn ban<U, BO>(&self, user: U, ban_options: &BO) -> Result<()> where U: Into<UserId>, BO: BanOptions { @@ -72,7 +71,7 @@ impl GuildId { /// /// Requires the [Ban Members] permission. /// - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[inline] pub fn bans(&self) -> Result<Vec<Ban>> { http::get_bans(self.0) } @@ -87,7 +86,7 @@ impl GuildId { /// Gets all of the guild's channels over the REST API. /// - /// [`Guild`]: struct.Guild.html + /// [`Guild`]: ../guild/struct.Guild.html pub fn channels(&self) -> Result<HashMap<ChannelId, GuildChannel>> { let mut channels = HashMap::new(); @@ -114,9 +113,9 @@ impl GuildId { /// let _channel = GuildId(7).create_channel("test", ChannelType::Voice, None); /// ``` /// - /// [`GuildChannel`]: struct.GuildChannel.html - /// [`http::create_channel`]: ../http/fn.create_channel.html - /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html + /// [`GuildChannel`]: ../channel/struct.GuildChannel.html + /// [`http::create_channel`]: ../../http/fn.create_channel.html + /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS #[inline] pub fn create_channel<C>(&self, name: &str, kind: ChannelType, category: C) -> Result<GuildChannel> where C: Into<Option<ChannelId>> { @@ -151,10 +150,10 @@ impl GuildId { /// how to read an image from the filesystem and encode it as base64. Most /// of the example can be applied similarly for this method. /// - /// [`EditProfile::avatar`]: ../builder/struct.EditProfile.html#method.avatar - /// [`Guild::create_emoji`]: struct.Guild.html#method.create_emoji - /// [`utils::read_image`]: ../utils/fn.read_image.html - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [`EditProfile::avatar`]: ../../builder/struct.EditProfile.html#method.avatar + /// [`Guild::create_emoji`]: ../guild/struct.Guild.html#method.create_emoji + /// [`utils::read_image`]: ../../utils/fn.read_image.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn create_emoji(&self, name: &str, image: &str) -> Result<Emoji> { let map = json!({ @@ -169,7 +168,7 @@ impl GuildId { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn create_integration<I>(&self, integration_id: I, kind: &str) -> Result<()> where I: Into<IntegrationId> { @@ -195,8 +194,8 @@ impl GuildId { /// /// **Note**: Requires the [Manage Roles] permission. /// - /// [`Guild::create_role`]: struct.Guild.html#method.create_role - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [`Guild::create_role`]: ../guild/struct.Guild.html#method.create_role + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn create_role<F: FnOnce(EditRole) -> EditRole>(&self, f: F) -> Result<Role> { let map = utils::vecmap_to_json_map(f(EditRole::default()).0); @@ -217,7 +216,7 @@ impl GuildId { /// /// **Note**: Requires the current user to be the owner of the guild. /// - /// [`Guild::delete`]: struct.Guild.html#method.delete + /// [`Guild::delete`]: ../guild/struct.Guild.html#method.delete #[inline] pub fn delete(&self) -> Result<PartialGuild> { http::delete_guild(self.0) } @@ -225,8 +224,8 @@ impl GuildId { /// /// Requires the [Manage Emojis] permission. /// - /// [`Emoji`]: struct.Emoji.html - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [`Emoji`]: ../guild/struct.Emoji.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn delete_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<()> { self._delete_emoji(emoji_id.into()) @@ -240,7 +239,7 @@ impl GuildId { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn delete_integration<I: Into<IntegrationId>>(&self, integration_id: I) -> Result<()> { self._delete_integration(integration_id.into()) @@ -257,9 +256,9 @@ impl GuildId { /// /// Requires the [Manage Roles] permission. /// - /// [`Role`]: struct.Role.html - /// [`Role::delete`]: struct.Role.html#method.delete - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [`Role`]: ../guild/struct.Role.html + /// [`Role::delete`]: ../guild/struct.Role.html#method.delete + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn delete_role<R: Into<RoleId>>(&self, role_id: R) -> Result<()> { self._delete_role(role_id.into()) @@ -276,8 +275,8 @@ impl GuildId { /// **Note**: Requires the current user to have the [Manage Guild] /// permission. /// - /// [`Guild::edit`]: struct.Guild.html#method.edit - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [`Guild::edit`]: ../guild/struct.Guild.html#method.edit + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn edit<F: FnOnce(EditGuild) -> EditGuild>(&mut self, f: F) -> Result<PartialGuild> { let map = utils::vecmap_to_json_map(f(EditGuild::default()).0); @@ -292,9 +291,9 @@ impl GuildId { /// /// Requires the [Manage Emojis] permission. /// - /// [`Emoji`]: struct.Emoji.html - /// [`Emoji::edit`]: struct.Emoji.html#method.edit - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [`Emoji`]: ../guild/struct.Emoji.html + /// [`Emoji::edit`]: ../guild/struct.Emoji.html#method.edit + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn edit_emoji<E: Into<EmojiId>>(&self, emoji_id: E, name: &str) -> Result<Emoji> { self._edit_emoji(emoji_id.into(), name) @@ -340,7 +339,7 @@ impl GuildId { /// /// Requires the [Change Nickname] permission. /// - /// [Change Nickname]: permissions/constant.CHANGE_NICKNAME.html + /// [Change Nickname]: ../permissions/struct.Permissions.html#associatedconstant.CHANGE_NICKNAME #[inline] pub fn edit_nickname(&self, new_nickname: Option<&str>) -> Result<()> { http::edit_nickname(self.0, new_nickname) @@ -360,8 +359,8 @@ impl GuildId { /// GuildId(7).edit_role(RoleId(8), |r| r.hoist(true)); /// ``` /// - /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [`Role`]: ../guild/struct.Role.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn edit_role<F, R>(&self, role_id: R, f: F) -> Result<Role> where F: FnOnce(EditRole) -> EditRole, R: Into<RoleId> { @@ -387,8 +386,8 @@ impl GuildId { /// GuildId(7).edit_role_position(RoleId(8), 2); /// ``` /// - /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [`Role`]: ../guild/struct.Role.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn edit_role_position<R>(&self, role_id: R, position: u64) -> Result<Vec<Role>> where R: Into<RoleId> { @@ -425,7 +424,7 @@ impl GuildId { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/struct.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn invites(&self) -> Result<Vec<RichInvite>> { http::get_guild_invites(self.0) } @@ -433,8 +432,8 @@ impl GuildId { /// /// Requires the [Kick Members] permission. /// - /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [`Member`]: ../guild/struct.Member.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS #[inline] pub fn kick<U: Into<UserId>>(&self, user_id: U) -> Result<()> { http::kick_member(self.0, user_id.into().0) @@ -449,8 +448,8 @@ impl GuildId { /// If the cache feature is enabled the cache will be checked /// first. If not found it will resort to an http request. /// - /// [`Guild`]: struct.Guild.html - /// [`Member`]: struct.Member.html + /// [`Guild`]: ../guild/struct.Guild.html + /// [`Member`]: ../guild/struct.Member.html #[inline] pub fn member<U: Into<UserId>>(&self, user_id: U) -> Result<Member> { self._member(user_id.into()) @@ -473,7 +472,7 @@ impl GuildId { /// value is 1000. Optionally pass in `after` to offset the results by a /// [`User`]'s Id. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html #[inline] pub fn members<U>(&self, limit: Option<u64>, after: Option<U>) -> Result<Vec<Member>> where U: Into<UserId> { @@ -488,7 +487,7 @@ impl GuildId { /// /// Requires the [Move Members] permission. /// - /// [Move Members]: permissions/constant.MOVE_MEMBERS.html + /// [Move Members]: ../permissions/struct.Permissions.html#associatedconstant.MOVE_MEMBERS #[inline] pub fn move_member<C, U>(&self, user_id: U, channel_id: C) -> Result<()> where C: Into<ChannelId>, U: Into<UserId> { @@ -514,8 +513,8 @@ impl GuildId { /// /// Requires the [Kick Members] permission. /// - /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [`Member`]: ../guild/struct.Member.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS pub fn prune_count(&self, days: u16) -> Result<GuildPrune> { let map = json!({ "days": days, @@ -556,7 +555,7 @@ impl GuildId { /// retrieve the total number of shards in use. If you already have the /// total, consider using [`utils::shard_id`]. /// - /// [`utils::shard_id`]: ../utils/fn.shard_id.html + /// [`utils::shard_id`]: ../../utils/fn.shard_id.html #[cfg(all(feature = "cache", feature = "utils"))] #[inline] pub fn shard_id(&self) -> u64 { ::utils::shard_id(self.0, CACHE.read().shard_count) } @@ -590,7 +589,7 @@ impl GuildId { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn start_integration_sync<I: Into<IntegrationId>>(&self, integration_id: I) -> Result<()> { self._start_integration_sync(integration_id.into()) @@ -609,9 +608,9 @@ impl GuildId { /// /// **Note**: Requires the [Kick Members] permission. /// - /// [`GuildPrune`]: struct.GuildPrune.html - /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [`GuildPrune`]: ../guild/struct.GuildPrune.html + /// [`Member`]: ../guild/struct.Member.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS #[inline] pub fn start_prune(&self, days: u16) -> Result<GuildPrune> { let map = json!({ @@ -625,8 +624,8 @@ impl GuildId { /// /// Requires the [Ban Members] permission. /// - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[inline] pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()> { self._unban(user_id.into()) @@ -640,7 +639,7 @@ impl GuildId { /// /// **Note**: Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn vanity_url(&self) -> Result<String> { http::get_guild_vanity_url(self.0) @@ -650,7 +649,7 @@ impl GuildId { /// /// **Note**: Requires the [Manage Webhooks] permission. /// - /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html + /// [Manage Webhooks]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS #[inline] pub fn webhooks(&self) -> Result<Vec<Webhook>> { http::get_guild_webhooks(self.0) } } diff --git a/src/model/guild/member.rs b/src/model/guild/member.rs index 8101700..0b31ba5 100644 --- a/src/model/guild/member.rs +++ b/src/model/guild/member.rs @@ -67,7 +67,7 @@ pub struct Member { /// /// Can't be longer than 32 characters. pub nick: Option<String>, - /// Vector of Ids of [`Role`]s given to the member. + /// Vector of Ids of [`Role`](struct.Role.html)s given to the member. pub roles: Vec<RoleId>, /// Attached User struct. #[serde(deserialize_with = "deserialize_sync_user", @@ -83,7 +83,7 @@ impl Member { /// **Note**: Requires the [Manage Roles] permission. /// /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[cfg(feature = "cache")] #[inline] pub fn add_role<R: Into<RoleId>>(&mut self, role_id: R) -> Result<()> { @@ -112,7 +112,7 @@ impl Member { /// **Note**: Requires the [Manage Roles] permission. /// /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[cfg(feature = "cache")] pub fn add_roles(&mut self, role_ids: &[RoleId]) -> Result<()> { self.roles.extend_from_slice(role_ids); @@ -140,9 +140,8 @@ impl Member { /// Returns a [`ModelError::GuildNotFound`] if the guild could not be /// found. /// - /// [`ModelError::GuildNotFound`]: enum.ModelError.html#variant.GuildNotFound - /// - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::GuildNotFound`]: ../error/enum.Error.html#variant.GuildNotFound + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[cfg(feature = "cache")] #[inline] pub fn ban<BO: BanOptions>(&self, ban_options: &BO) -> Result<()> { @@ -235,8 +234,8 @@ impl Member { /// See [`EditMember`] for the permission(s) required for separate builder /// methods, as well as usage of this. /// - /// [`Guild::edit_member`]: ../model/guild/struct.Guild.html#method.edit_member - /// [`EditMember`]: ../builder/struct.EditMember.html + /// [`Guild::edit_member`]: 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<()> { let map = utils::vecmap_to_json_map(f(EditMember::default()).0); @@ -312,9 +311,9 @@ impl Member { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform the kick. /// - /// [`ModelError::GuildNotFound`]: enum.ModelError.html#variant.GuildNotFound - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [`ModelError::GuildNotFound`]: ../error/enum.Error.html#variant.GuildNotFound + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS pub fn kick(&self) -> Result<()> { #[cfg(feature = "cache")] { @@ -353,8 +352,8 @@ impl Member { /// And/or returns [`ModelError::ItemMissing`] if the "default channel" of the guild is not /// found. /// - /// [`ModelError::GuildNotFound`]: enum.ModelError.html#variant.GuildNotFound - /// [`ModelError::ItemMissing`]: enum.ModelError.html#variant.ItemMissing + /// [`ModelError::GuildNotFound`]: ../error/enum.Error.html#variant.GuildNotFound + /// [`ModelError::ItemMissing`]: ../error/enum.Error.html#variant.ItemMissing #[cfg(feature = "cache")] pub fn permissions(&self) -> Result<Permissions> { let guild = match self.guild_id.find() { @@ -373,7 +372,7 @@ impl Member { /// **Note**: Requires the [Manage Roles] permission. /// /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[cfg(feature = "cache")] #[inline] pub fn remove_role<R: Into<RoleId>>(&mut self, role_id: R) -> Result<()> { @@ -401,7 +400,7 @@ impl Member { /// **Note**: Requires the [Manage Roles] permission. /// /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[cfg(feature = "cache")] pub fn remove_roles(&mut self, role_ids: &[RoleId]) -> Result<()> { self.roles.retain(|r| !role_ids.contains(r)); @@ -447,9 +446,9 @@ impl Member { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[cfg(feature = "cache")] pub fn unban(&self) -> Result<()> { http::remove_ban(self.guild_id.0, self.user.read().id.0) diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 30651d6..b5c6967 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -101,7 +101,7 @@ pub struct Guild { /// if the [`member_count`] is greater than the `LARGE_THRESHOLD` set by /// the library. /// - /// [`ReadyEvent`]: events/struct.ReadyEvent.html + /// [`ReadyEvent`]: ../event/struct.ReadyEvent.html /// [`member_count`]: #structfield.member_count #[serde(serialize_with = "serialize_gen_map")] pub members: HashMap<UserId, Member>, @@ -109,17 +109,17 @@ pub struct Guild { /// [`Role`]s or [`User`]s with moderation permissions. /// /// [`Role`]: struct.Role.html - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html pub mfa_level: MfaLevel, /// The name of the guild. pub name: String, /// The Id of the [`User`] who owns the guild. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html pub owner_id: UserId, /// A mapping of [`User`]s' Ids to their current presences. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html #[serde(serialize_with = "serialize_gen_map")] pub presences: HashMap<UserId, Presence>, /// The region that the voice servers that the guild uses are located in. @@ -129,10 +129,8 @@ pub struct Guild { pub roles: HashMap<RoleId, Role>, /// An identifying hash of the guild's splash icon. /// - /// If the [`InviteSplash`] feature is enabled, this can be used to generate + /// If the [`"InviteSplash"`] feature is enabled, this can be used to generate /// a URL to a splash image. - /// - /// [`InviteSplash`]: enum.Feature.html#variant.InviteSplash pub splash: Option<String>, /// The ID of the channel to which system messages are sent. pub system_channel_id: Option<ChannelId>, @@ -140,7 +138,7 @@ pub struct Guild { pub verification_level: VerificationLevel, /// A mapping of of [`User`]s to their current voice state. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html #[serde(serialize_with = "serialize_gen_map")] pub voice_states: HashMap<UserId, VoiceState>, } @@ -224,12 +222,11 @@ impl Guild { /// Returns a [`ModelError::DeleteMessageDaysAmount`] if the number of /// days' worth of messages to delete is over the maximum. /// - /// [`ModelError::DeleteMessageDaysAmount`]: - /// enum.ModelError.html#variant.DeleteMessageDaysAmount - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [`Guild::ban`]: struct.Guild.html#method.ban - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::DeleteMessageDaysAmount`]: ../error/enum.Error.html#variant.DeleteMessageDaysAmount + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [`Guild::ban`]: ../guild/struct.Guild.html#method.ban + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[inline] pub fn ban<U: Into<UserId>, BO: BanOptions>(&self, user: U, options: &BO) -> Result<()> { self._ban(user.into(), options) @@ -260,8 +257,8 @@ impl Guild { /// if the current user does not have permission to perform bans. /// /// [`Ban`]: struct.Ban.html - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS pub fn bans(&self) -> Result<Vec<Ban>> { #[cfg(feature = "cache")] { @@ -314,7 +311,7 @@ impl Guild { /// /// [`Guild`]: struct.Guild.html /// [`PartialGuild`]: struct.PartialGuild.html - /// [`Shard`]: ../gateway/struct.Shard.html + /// [`Shard`]: ../../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<PartialGuild> { @@ -346,9 +343,9 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`Channel`]: struct.Channel.html - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html + /// [`Channel`]: ../channel/enum.Channel.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS pub fn create_channel<C>(&self, name: &str, kind: ChannelType, category: C) -> Result<GuildChannel> where C: Into<Option<ChannelId>> { #[cfg(feature = "cache")] @@ -379,9 +376,9 @@ impl Guild { /// how to read an image from the filesystem and encode it as base64. Most /// of the example can be applied similarly for this method. /// - /// [`EditProfile::avatar`]: ../builder/struct.EditProfile.html#method.avatar - /// [`utils::read_image`]: ../fn.read_image.html - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [`EditProfile::avatar`]: ../../builder/struct.EditProfile.html#method.avatar + /// [`utils::read_image`]: ../../utils/fn.read_image.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn create_emoji(&self, name: &str, image: &str) -> Result<Emoji> { self.id.create_emoji(name, image) @@ -391,7 +388,7 @@ impl Guild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn create_integration<I>(&self, integration_id: I, kind: &str) -> Result<()> where I: Into<IntegrationId> { @@ -417,9 +414,9 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES pub fn create_role<F>(&self, f: F) -> Result<Role> where F: FnOnce(EditRole) -> EditRole { #[cfg(feature = "cache")] @@ -444,7 +441,7 @@ impl Guild { /// If the `cache` is enabled, then returns a [`ModelError::InvalidUser`] /// if the current user is not the guild owner. /// - /// [`ModelError::InvalidUser`]: enum.ModelError.html#variant.InvalidUser + /// [`ModelError::InvalidUser`]: ../error/enum.Error.html#variant.InvalidUser pub fn delete(&self) -> Result<PartialGuild> { #[cfg(feature = "cache")] { @@ -463,7 +460,7 @@ impl Guild { /// Requires the [Manage Emojis] permission. /// /// [`Emoji`]: struct.Emoji.html - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn delete_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<()> { self.id.delete_emoji(emoji_id) @@ -473,7 +470,7 @@ impl Guild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn delete_integration<I: Into<IntegrationId>>(&self, integration_id: I) -> Result<()> { self.id.delete_integration(integration_id) @@ -488,7 +485,7 @@ impl Guild { /// /// [`Role`]: struct.Role.html /// [`Role::delete`]: struct.Role.html#method.delete - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn delete_role<R: Into<RoleId>>(&self, role_id: R) -> Result<()> { self.id.delete_role(role_id) @@ -520,8 +517,8 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD pub fn edit<F>(&mut self, f: F) -> Result<()> where F: FnOnce(EditGuild) -> EditGuild { #[cfg(feature = "cache")] @@ -564,7 +561,7 @@ impl Guild { /// /// [`Emoji`]: struct.Emoji.html /// [`Emoji::edit`]: struct.Emoji.html#method.edit - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn edit_emoji<E: Into<EmojiId>>(&self, emoji_id: E, name: &str) -> Result<Emoji> { self.id.edit_emoji(emoji_id, name) @@ -601,8 +598,8 @@ impl Guild { /// if the current user does not have permission to change their own /// nickname. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Change Nickname]: permissions/constant.CHANGE_NICKNAME.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Change Nickname]: ../permissions/struct.Permissions.html#associatedconstant.CHANGE_NICKNAME pub fn edit_nickname(&self, new_nickname: Option<&str>) -> Result<()> { #[cfg(feature = "cache")] { @@ -628,7 +625,7 @@ impl Guild { /// guild.edit_role(RoleId(7), |r| r.hoist(true)); /// ``` /// - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn edit_role<F, R>(&self, role_id: R, f: F) -> Result<Role> where F: FnOnce(EditRole) -> EditRole, R: Into<RoleId> { @@ -648,7 +645,7 @@ impl Guild { /// ``` /// /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn edit_role_position<R>(&self, role_id: R, position: u64) -> Result<Vec<Role>> where R: Into<RoleId> { @@ -755,8 +752,8 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD pub fn invites(&self) -> Result<Vec<RichInvite>> { #[cfg(feature = "cache")] { @@ -780,7 +777,7 @@ impl Guild { /// Requires the [Kick Members] permission. /// /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS #[inline] pub fn kick<U: Into<UserId>>(&self, user_id: U) -> Result<()> { self.id.kick(user_id) } @@ -790,7 +787,7 @@ impl Guild { /// Gets a user's [`Member`] for the guild by Id. /// - /// [`Guild`]: struct.Guild.html + /// [`Guild`]: ../guild/struct.Guild.html /// [`Member`]: struct.Member.html #[inline] pub fn member<U: Into<UserId>>(&self, user_id: U) -> Result<Member> { self.id.member(user_id) } @@ -801,7 +798,7 @@ impl Guild { /// value is 1000. Optionally pass in `after` to offset the results by a /// [`User`]'s Id. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html #[inline] pub fn members<U>(&self, limit: Option<u64>, after: Option<U>) -> Result<Vec<Member>> where U: Into<UserId> { @@ -1174,7 +1171,7 @@ impl Guild { /// /// Requires the [Move Members] permission. /// - /// [Move Members]: permissions/constant.MOVE_MEMBERS.html + /// [Move Members]: ../permissions/struct.Permissions.html#associatedconstant.MOVE_MEMBERS #[inline] pub fn move_member<C, U>(&self, user_id: U, channel_id: C) -> Result<()> where C: Into<ChannelId>, U: Into<UserId> { @@ -1194,7 +1191,7 @@ impl Guild { /// Calculate a [`User`]'s permissions in a given channel in the guild. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html #[inline] pub fn permissions_in<C, U>(&self, channel_id: C, user_id: U) -> Permissions where C: Into<ChannelId>, U: Into<UserId> { @@ -1349,10 +1346,10 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions /// [`GuildPrune`]: struct.GuildPrune.html /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS pub fn prune_count(&self, days: u16) -> Result<GuildPrune> { #[cfg(feature = "cache")] { @@ -1385,7 +1382,7 @@ impl Guild { /// retrieve the total number of shards in use. If you already have the /// total, consider using [`utils::shard_id`]. /// - /// [`utils::shard_id`]: ../utils/fn.shard_id.html + /// [`utils::shard_id`]: ../../utils/fn.shard_id.html #[cfg(all(feature = "cache", feature = "utils"))] #[inline] pub fn shard_id(&self) -> u64 { self.id.shard_id() } @@ -1425,7 +1422,7 @@ impl Guild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn start_integration_sync<I: Into<IntegrationId>>(&self, integration_id: I) -> Result<()> { self.id.start_integration_sync(integration_id) @@ -1442,10 +1439,10 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions /// [`GuildPrune`]: struct.GuildPrune.html /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS pub fn start_prune(&self, days: u16) -> Result<GuildPrune> { #[cfg(feature = "cache")] { @@ -1468,9 +1465,9 @@ impl Guild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()> { #[cfg(feature = "cache")] { @@ -1488,7 +1485,7 @@ impl Guild { /// /// **Note**: Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn vanity_url(&self) -> Result<String> { self.id.vanity_url() @@ -1498,7 +1495,7 @@ impl Guild { /// /// **Note**: Requires the [Manage Webhooks] permission. /// - /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html + /// [Manage Webhooks]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS #[inline] pub fn webhooks(&self) -> Result<Vec<Webhook>> { self.id.webhooks() } diff --git a/src/model/guild/partial_guild.rs b/src/model/guild/partial_guild.rs index d324517..7fff7be 100644 --- a/src/model/guild/partial_guild.rs +++ b/src/model/guild/partial_guild.rs @@ -55,10 +55,9 @@ impl PartialGuild { /// Returns a [`ModelError::DeleteMessageDaysAmount`] if the number of /// days' worth of messages to delete is over the maximum. /// - /// [`ModelError::DeleteMessageDaysAmount`]: - /// enum.ModelError.html#variant.DeleteMessageDaysAmount - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`ModelError::DeleteMessageDaysAmount`]: ../error/enum.Error.html#variant.DeleteMessageDaysAmount + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS pub fn ban<U: Into<UserId>>(&self, user: U, delete_message_days: u8) -> Result<()> { if delete_message_days > 7 { return Err(Error::Model( @@ -73,7 +72,7 @@ impl PartialGuild { /// /// Requires the [Ban Members] permission. /// - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[inline] pub fn bans(&self) -> Result<Vec<Ban>> { self.id.bans() } @@ -99,9 +98,9 @@ impl PartialGuild { /// guild.create_channel("test", ChannelType::Voice, None); /// ``` /// - /// [`GuildChannel`]: struct.GuildChannel.html - /// [`http::create_channel`]: ../http/fn.create_channel.html - /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html + /// [`GuildChannel`]: ../channel/struct.GuildChannel.html + /// [`http::create_channel`]: ../../http/fn.create_channel.html + /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS #[inline] pub fn create_channel<C>(&self, name: &str, kind: ChannelType, category: C) -> Result<GuildChannel> where C: Into<Option<ChannelId>> { @@ -121,10 +120,10 @@ impl PartialGuild { /// how to read an image from the filesystem and encode it as base64. Most /// of the example can be applied similarly for this method. /// - /// [`EditProfile::avatar`]: ../builder/struct.EditProfile.html#method.avatar + /// [`EditProfile::avatar`]: ../../builder/struct.EditProfile.html#method.avatar /// [`Guild::create_emoji`]: struct.Guild.html#method.create_emoji - /// [`utils::read_image`]: ../utils/fn.read_image.html - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [`utils::read_image`]: ../../utils/fn.read_image.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn create_emoji(&self, name: &str, image: &str) -> Result<Emoji> { self.id.create_emoji(name, image) @@ -134,7 +133,7 @@ impl PartialGuild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn create_integration<I>(&self, integration_id: I, kind: &str) -> Result<()> where I: Into<IntegrationId> { @@ -152,9 +151,9 @@ impl PartialGuild { /// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`] /// if the current user does not have permission to perform bans. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions /// [`Guild::create_role`]: struct.Guild.html#method.create_role - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn create_role<F: FnOnce(EditRole) -> EditRole>(&self, f: F) -> Result<Role> { self.id.create_role(f) @@ -172,7 +171,7 @@ impl PartialGuild { /// Requires the [Manage Emojis] permission. /// /// [`Emoji`]: struct.Emoji.html - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [Manage Emojis]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn delete_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<()> { self.id.delete_emoji(emoji_id) @@ -182,7 +181,7 @@ impl PartialGuild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn delete_integration<I: Into<IntegrationId>>(&self, integration_id: I) -> Result<()> { self.id.delete_integration(integration_id) @@ -197,7 +196,7 @@ impl PartialGuild { /// /// [`Role`]: struct.Role.html /// [`Role::delete`]: struct.Role.html#method.delete - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[inline] pub fn delete_role<R: Into<RoleId>>(&self, role_id: R) -> Result<()> { self.id.delete_role(role_id) @@ -208,7 +207,7 @@ impl PartialGuild { /// **Note**: Requires the current user to have the [Manage Guild] /// permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD pub fn edit<F>(&mut self, f: F) -> Result<()> where F: FnOnce(EditGuild) -> EditGuild { match self.id.edit(f) { @@ -242,7 +241,8 @@ impl PartialGuild { /// /// [`Emoji`]: struct.Emoji.html /// [`Emoji::edit`]: struct.Emoji.html#method.edit - /// [Manage Emojis]: permissions/constant.MANAGE_EMOJIS.html + /// [Manage Emojis]: + /// ../permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS #[inline] pub fn edit_emoji<E: Into<EmojiId>>(&self, emoji_id: E, name: &str) -> Result<Emoji> { self.id.edit_emoji(emoji_id, name) @@ -281,8 +281,8 @@ impl PartialGuild { /// if the current user does not have permission to change their own /// nickname. /// - /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions - /// [Change Nickname]: permissions/constant.CHANGE_NICKNAME.html + /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions + /// [Change Nickname]: ../permissions/struct.Permissions.html#associatedconstant.CHANGE_NICKNAME #[inline] pub fn edit_nickname(&self, new_nickname: Option<&str>) -> Result<()> { self.id.edit_nickname(new_nickname) @@ -299,7 +299,7 @@ impl PartialGuild { /// Requires the [Kick Members] permission. /// /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS #[inline] pub fn kick<U: Into<UserId>>(&self, user_id: U) -> Result<()> { self.id.kick(user_id) } @@ -320,7 +320,7 @@ impl PartialGuild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn invites(&self) -> Result<Vec<RichInvite>> { self.id.invites() } @@ -340,7 +340,7 @@ impl PartialGuild { /// value is 1000. Optionally pass in `after` to offset the results by a /// [`User`]'s Id. /// - /// [`User`]: struct.User.html + /// [`User`]: ../user/struct.User.html pub fn members<U>(&self, limit: Option<u64>, after: Option<U>) -> Result<Vec<Member>> where U: Into<UserId> { self.id.members(limit, after) @@ -350,7 +350,7 @@ impl PartialGuild { /// /// Requires the [Move Members] permission. /// - /// [Move Members]: permissions/constant.MOVE_MEMBERS.html + /// [Move Members]: ../permissions/struct.Permissions.html#associatedconstant.MOVE_MEMBERS #[inline] pub fn move_member<C, U>(&self, user_id: U, channel_id: C) -> Result<()> where C: Into<ChannelId>, U: Into<UserId> { @@ -363,7 +363,7 @@ impl PartialGuild { /// Requires the [Kick Members] permission. /// /// [`Member`]: struct.Member.html - /// [Kick Members]: permissions/constant.KICK_MEMBERS.html + /// [Kick Members]: ../permissions/struct.Permissions.html#associatedconstant.KICK_MEMBERS #[inline] pub fn prune_count(&self, days: u16) -> Result<GuildPrune> { self.id.prune_count(days) } @@ -376,7 +376,7 @@ impl PartialGuild { /// retrieve the total number of shards in use. If you already have the /// total, consider using [`utils::shard_id`]. /// - /// [`utils::shard_id`]: ../utils/fn.shard_id.html + /// [`utils::shard_id`]: ../../utils/fn.shard_id.html #[cfg(all(feature = "cache", feature = "utils"))] #[inline] pub fn shard_id(&self) -> u64 { self.id.shard_id() } @@ -416,7 +416,7 @@ impl PartialGuild { /// /// Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn start_integration_sync<I: Into<IntegrationId>>(&self, integration_id: I) -> Result<()> { self.id.start_integration_sync(integration_id) @@ -426,8 +426,8 @@ impl PartialGuild { /// /// Requires the [Ban Members] permission. /// - /// [`User`]: struct.User.html - /// [Ban Members]: permissions/constant.BAN_MEMBERS.html + /// [`User`]: ../user/struct.User.html + /// [Ban Members]: ../permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS #[inline] pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()> { self.id.unban(user_id) } @@ -435,7 +435,7 @@ impl PartialGuild { /// /// **Note**: Requires the [Manage Guild] permission. /// - /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD #[inline] pub fn vanity_url(&self) -> Result<String> { self.id.vanity_url() @@ -445,7 +445,7 @@ impl PartialGuild { /// /// **Note**: Requires the [Manage Webhooks] permission. /// - /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html + /// [Manage Webhooks]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS #[inline] pub fn webhooks(&self) -> Result<Vec<Webhook>> { self.id.webhooks() } diff --git a/src/model/guild/role.rs b/src/model/guild/role.rs index 53ec478..b66c0a0 100644 --- a/src/model/guild/role.rs +++ b/src/model/guild/role.rs @@ -50,7 +50,7 @@ pub struct Role { /// /// See the [`permissions`] module for more information. /// - /// [`permissions`]: permissions/index.html + /// [`permissions`]: ../permissions/index.html pub permissions: Permissions, /// The role's position in the position list. Roles are considered higher in /// hierarchy if their position is higher. @@ -65,7 +65,7 @@ impl Role { /// /// **Note** Requires the [Manage Roles] permission. /// - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[cfg(feature = "cache")] #[inline] pub fn delete(&self) -> Result<()> { http::delete_role(self.find_guild()?.0, self.id.0) } @@ -87,7 +87,7 @@ impl Role { /// ``` /// /// [`Role`]: struct.Role.html - /// [Manage Roles]: permissions/constant.MANAGE_ROLES.html + /// [Manage Roles]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES #[cfg(all(feature = "builder", feature = "cache"))] pub fn edit<F: FnOnce(EditRole) -> EditRole>(&self, f: F) -> Result<Role> { self.find_guild() @@ -101,7 +101,7 @@ impl Role { /// Returns a [`ModelError::GuildNotFound`] if a guild is not in the cache /// that contains the role. /// - /// [`ModelError::GuildNotFound`]: enum.ModelError.html#variant.GuildNotFound + /// [`ModelError::GuildNotFound`]: ../error/enum.Error.html#variant.GuildNotFound #[cfg(feature = "cache")] pub fn find_guild(&self) -> Result<GuildId> { for guild in CACHE.read().guilds.values() { |