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/mod.rs | |
| 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/mod.rs')
| -rw-r--r-- | src/model/guild/mod.rs | 107 |
1 files changed, 52 insertions, 55 deletions
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() } |