diff --git a/src/builder/create_embed.rs b/src/builder/create_embed.rs index d36ad3ef5d2..f420a8cf707 100644 --- a/src/builder/create_embed.rs +++ b/src/builder/create_embed.rs @@ -10,7 +10,7 @@ //! //! Documentation for embeds can be found [here]. //! -//! [`ChannelId::send_message`]: ../model/struct.ChannelId.html#method.send_message +//! [`ChannelId::send_message`]: ../model/id/struct.ChannelId.html#method.send_message //! [`CreateEmbed`]: struct.CreateEmbed.html //! [`ExecuteWebhook::embeds`]: struct.ExecuteWebhook.html#method.embeds //! [here]: https://discordapp.com/developers/docs/resources/channel#embed-object @@ -35,8 +35,8 @@ use utils::Colour; /// Refer to the documentation for [`ChannelId::send_message`] for a very in-depth /// example on how to use this. /// -/// [`ChannelId::send_message`]: ../model/struct.ChannelId.html#method.send_message -/// [`Embed`]: ../model/struct.Embed.html +/// [`ChannelId::send_message`]: ../model/id/struct.ChannelId.html#method.send_message +/// [`Embed`]: ../model/channel/struct.Embed.html /// [`ExecuteWebhook::embeds`]: struct.ExecuteWebhook.html#method.embeds #[derive(Clone, Debug)] pub struct CreateEmbed(pub VecMap<&'static str, Value>); @@ -300,7 +300,7 @@ impl CreateEmbed { /// Note however, you have to be sure you set an attachment (with [`ChannelId::send_files`]) /// with the provided filename. Or else this won't work. /// - /// [`ChannelId::send_files`]: ../model/struct.ChannelId.html#send_files + /// [`ChannelId::send_files`]: ../model/id/struct.ChannelId.html#send_files pub fn attachment(self, filename: &str) -> Self { self.image(&format!("attachment://{}", filename)) } @@ -388,7 +388,7 @@ impl From for CreateEmbed { /// /// Requires that you specify a [`name`]. /// -/// [`Embed`]: ../model/struct.Embed.html +/// [`Embed`]: ../model/channel/struct.Embed.html /// [`CreateEmbed::author`]: struct.CreateEmbed.html#method.author /// [`name`]: #method.name #[derive(Clone, Debug, Default)] @@ -422,7 +422,7 @@ impl CreateEmbedAuthor { /// /// This does not require any field be set. /// -/// [`Embed`]: ../model/struct.Embed.html +/// [`Embed`]: ../model/channel/struct.Embed.html /// [`CreateEmbed::footer`]: struct.CreateEmbed.html#method.footer #[derive(Clone, Debug, Default)] pub struct CreateEmbedFooter(pub VecMap<&'static str, Value>); diff --git a/src/builder/create_invite.rs b/src/builder/create_invite.rs index b3344ccfb80..c9b00ffcaaf 100644 --- a/src/builder/create_invite.rs +++ b/src/builder/create_invite.rs @@ -59,8 +59,8 @@ use utils::VecMap; /// client.start().unwrap(); /// ``` /// -/// [`GuildChannel::create_invite`]: ../model/struct.GuildChannel.html#method.create_invite -/// [`RichInvite`]: ../model/struct.Invite.html +/// [`GuildChannel::create_invite`]: ../model/guild/struct.GuildChannel.html#method.create_invite +/// [`RichInvite`]: ../model/guild/struct.Invite.html #[derive(Clone, Debug)] pub struct CreateInvite(pub VecMap<&'static str, Value>); diff --git a/src/builder/create_message.rs b/src/builder/create_message.rs index 2a89c0b5b52..07242f0b682 100644 --- a/src/builder/create_message.rs +++ b/src/builder/create_message.rs @@ -34,8 +34,8 @@ use utils::{self, VecMap}; /// .description("With a description"))); /// ``` /// -/// [`ChannelId::say`]: ../model/struct.ChannelId.html#method.say -/// [`ChannelId::send_message`]: ../model/struct.ChannelId.html#method.send_message +/// [`ChannelId::say`]: ../model/id/struct.ChannelId.html#method.say +/// [`ChannelId::send_message`]: ../model/id/struct.ChannelId.html#method.send_message /// [`content`]: #method.content /// [`embed`]: #method.embed /// [`http::send_message`]: ../http/fn.send_message.html @@ -86,7 +86,7 @@ impl Default for CreateMessage { /// Creates a map for sending a [`Message`], setting [`tts`] to `false` by /// default. /// - /// [`Message`]: ../model/struct.Message.html + /// [`Message`]: ../model/channel/struct.Message.html /// [`tts`]: #method.tts fn default() -> CreateMessage { let mut map = VecMap::new(); diff --git a/src/builder/edit_channel.rs b/src/builder/edit_channel.rs index 2ea57079f01..b8d897b30ec 100644 --- a/src/builder/edit_channel.rs +++ b/src/builder/edit_channel.rs @@ -17,8 +17,8 @@ use model::id::ChannelId; /// } /// ``` /// -/// [`GuildChannel`]: ../model/struct.GuildChannel.html -/// [`GuildChannel::edit`]: ../model/struct.GuildChannel.html#method.edit +/// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html +/// [`GuildChannel::edit`]: ../model/channel/struct.GuildChannel.html#method.edit #[derive(Clone, Debug, Default)] pub struct EditChannel(pub VecMap<&'static str, Value>); @@ -27,7 +27,7 @@ impl EditChannel { /// /// This is for [voice] channels only. /// - /// [voice]: ../model/enum.ChannelType.html#variant.Voice + /// [voice]: ../model/channel/enum.ChannelType.html#variant.Voice pub fn bitrate(mut self, bitrate: u64) -> Self { self.0.insert("bitrate", Value::Number(Number::from(bitrate))); @@ -56,7 +56,7 @@ impl EditChannel { /// /// This is for [text] channels only. /// - /// [text]: ../model/enum.ChannelType.html#variant.Text + /// [text]: ../model/channel/enum.ChannelType.html#variant.Text pub fn topic(mut self, topic: &str) -> Self { self.0.insert("topic", Value::String(topic.to_string())); @@ -67,7 +67,7 @@ impl EditChannel { /// /// This is for [voice] channels only. /// - /// [voice]: ../model/enum.ChannelType.html#variant.Voice + /// [voice]: ../model/channel/enum.ChannelType.html#variant.Voice pub fn user_limit(mut self, user_limit: u64) -> Self { self.0.insert("user_limit", Value::Number(Number::from(user_limit))); @@ -78,8 +78,8 @@ impl EditChannel { /// /// This is for [text] and [voice] channels only. /// - /// [text]: ../model/enum.ChannelType.html#variant.Text - /// [voice]: ../model/enum.ChannelType.html#variant.Voice + /// [text]: ../model/channel/enum.ChannelType.html#variant.Text + /// [voice]: ../model/channel/enum.ChannelType.html#variant.Voice pub fn category(mut self, category: C) -> Self where C: Into> { let parent_id = match category.into() { diff --git a/src/builder/edit_guild.rs b/src/builder/edit_guild.rs index ee6bce66ad1..c24b9b45be1 100644 --- a/src/builder/edit_guild.rs +++ b/src/builder/edit_guild.rs @@ -8,8 +8,8 @@ use utils::VecMap; /// **Note**: Editing a guild requires that the current user have the /// [Manage Guild] permission. /// -/// [`Guild::edit`]: ../model/struct.Guild.html#method.edit -/// [`Guild`]: ../model/struct.Guild.html +/// [`Guild::edit`]: ../model/guild/struct.Guild.html#method.edit +/// [`Guild`]: ../model/guild/struct.Guild.html /// [Manage Guild]: ../model/permissions/constant.MANAGE_GUILD.html #[derive(Clone, Debug, Default)] pub struct EditGuild(pub VecMap<&'static str, Value>); @@ -130,7 +130,7 @@ impl EditGuild { /// # } /// ``` /// - /// [`Region::UsWest`]: ../model/enum.Region.html#variant.UsWest + /// [`Region::UsWest`]: ../model/guild/enum.Region.html#variant.UsWest pub fn region(mut self, region: Region) -> Self { self.0.insert("region", Value::String(region.name().to_string())); @@ -139,11 +139,10 @@ impl EditGuild { /// Set the splash image of the guild on the invitation page. /// - /// Requires that the guild have the [`InviteSplash`] feature enabled. + /// Requires that the guild have the `INVITE_SPLASH` feature enabled. /// You can check this through a guild's [`features`] list. /// - /// [`InviteSplash`]: ../model/enum.Feature.html#variant.InviteSplash - /// [`features`]: ../model/struct.LiveGuild.html#structfield.features + /// [`features`]: ../model/guild/struct.Guild.html#structfield.features pub fn splash(mut self, splash: Option<&str>) -> Self { let splash = splash.map_or(Value::Null, |x| Value::String(x.to_string())); self.0.insert("splash", splash); @@ -179,8 +178,8 @@ impl EditGuild { /// } /// ``` /// - /// [`VerificationLevel`]: ../model/enum.VerificationLevel.html - /// [`VerificationLevel::High`]: ../model/enum.VerificationLevel.html#variant.High + /// [`VerificationLevel`]: ../model/guild/enum.VerificationLevel.html + /// [`VerificationLevel::High`]: ../model/guild/enum.VerificationLevel.html#variant.High pub fn verification_level(mut self, verification_level: V) -> Self where V: Into { let num = Value::Number(Number::from(verification_level.into().num())); diff --git a/src/builder/edit_member.rs b/src/builder/edit_member.rs index efc9fb9a5da..19edb5e3fd2 100644 --- a/src/builder/edit_member.rs +++ b/src/builder/edit_member.rs @@ -5,8 +5,8 @@ use utils::VecMap; /// A builder which edits the properties of a [`Member`], to be used in /// conjunction with [`Member::edit`]. /// -/// [`Member`]: ../model/struct.Member.html -/// [`Member::edit`]: ../model/struct.Member.html#method.edit +/// [`Member`]: ../model/guild/struct.Member.html +/// [`Member::edit`]: ../model/guild/struct.Member.html#method.edit #[derive(Clone, Debug, Default)] pub struct EditMember(pub VecMap<&'static str, Value>); diff --git a/src/builder/edit_profile.rs b/src/builder/edit_profile.rs index e27fb92dae0..df428b43d69 100644 --- a/src/builder/edit_profile.rs +++ b/src/builder/edit_profile.rs @@ -4,7 +4,7 @@ use utils::VecMap; /// A builder to edit the current user's settings, to be used in conjunction /// with [`CurrentUser::edit`]. /// -/// [`CurrentUser::edit`]: ../model/struct.CurrentUser.html#method.edit +/// [`CurrentUser::edit`]: ../model/user/struct.CurrentUser.html#method.edit #[derive(Clone, Debug, Default)] pub struct EditProfile(pub VecMap<&'static str, Value>); diff --git a/src/builder/edit_role.rs b/src/builder/edit_role.rs index 54511ec7498..9f0fce1d6f8 100644 --- a/src/builder/edit_role.rs +++ b/src/builder/edit_role.rs @@ -32,20 +32,20 @@ use utils::VecMap; /// .name("a test role")); /// ``` /// -/// [`PartialGuild::create_role`]: ../model/struct.PartialGuild.html#method.create_role -/// [`Guild::create_role`]: ../model/struct.Guild.html#method.create_role -/// [`Guild::edit_role`]: ../model/struct.Guild.html#method.edit_role -/// [`GuildId::create_role`]: ../model/struct.GuildId.html#method.create_role -/// [`GuildId::edit_role`]: ../model/struct.GuildId.html#method.edit_role -/// [`Role`]: ../model/struct.Role.html -/// [`Role::edit`]: ../model/struct.Role.html#method.edit +/// [`PartialGuild::create_role`]: ../model/guild/struct.PartialGuild.html#method.create_role +/// [`Guild::create_role`]: ../model/guild/struct.Guild.html#method.create_role +/// [`Guild::edit_role`]: ../model/guild/struct.Guild.html#method.edit_role +/// [`GuildId::create_role`]: ../model/id/struct.GuildId.html#method.create_role +/// [`GuildId::edit_role`]: ../model/id/struct.GuildId.html#method.edit_role +/// [`Role`]: ../model/guild/struct.Role.html +/// [`Role::edit`]: ../model/guild/struct.Role.html#method.edit #[derive(Clone, Debug, Default)] pub struct EditRole(pub VecMap<&'static str, Value>); impl EditRole { /// Creates a new builder with the values of the given [`Role`]. /// - /// [`Role`]: ../model/struct.Role.html + /// [`Role`]: ../model/guild/struct.Role.html pub fn new(role: &Role) -> Self { let mut map = VecMap::with_capacity(8); diff --git a/src/builder/execute_webhook.rs b/src/builder/execute_webhook.rs index 26600efa6a7..65823bb4fb1 100644 --- a/src/builder/execute_webhook.rs +++ b/src/builder/execute_webhook.rs @@ -43,8 +43,8 @@ use utils::VecMap; /// .embeds(vec![website, resources])); /// ``` /// -/// [`Webhook`]: ../model/struct.Webhook.html -/// [`Webhook::execute`]: ../model/struct.Webhook.html#method.execute +/// [`Webhook`]: ../model/webhook/struct.Webhook.html +/// [`Webhook::execute`]: ../model/webhook/struct.Webhook.html#method.execute /// [`execute_webhook`]: ../http/fn.execute_webhook.html #[derive(Clone, Debug)] pub struct ExecuteWebhook(pub VecMap<&'static str, Value>); @@ -109,8 +109,8 @@ impl ExecuteWebhook { /// Refer to the [struct-level documentation] for an example on how to use /// embeds. /// - /// [`Embed::fake`]: ../model/struct.Embed.html#method.fake - /// [`Webhook::execute`]: ../model/struct.Webhook.html#method.execute + /// [`Embed::fake`]: ../model/channel/struct.Embed.html#method.fake + /// [`Webhook::execute`]: ../model/webhook/struct.Webhook.html#method.execute /// [struct-level documentation]: #examples pub fn embeds(mut self, embeds: Vec) -> Self { self.0.insert("embeds", Value::Array(embeds)); @@ -176,7 +176,7 @@ impl Default for ExecuteWebhook { /// let executer = ExecuteWebhook::default(); /// ``` /// - /// [`Webhook`]: ../model/struct.Webhook.html + /// [`Webhook`]: ../model/webhook/struct.Webhook.html /// [`tts`]: #method.tts fn default() -> ExecuteWebhook { let mut map = VecMap::new(); diff --git a/src/builder/get_messages.rs b/src/builder/get_messages.rs index 01003f677e9..f302ff0628f 100644 --- a/src/builder/get_messages.rs +++ b/src/builder/get_messages.rs @@ -48,7 +48,7 @@ use utils::VecMap; /// # } /// ``` /// -/// [`GuildChannel::messages`]: ../model/struct.GuildChannel.html#method.messages +/// [`GuildChannel::messages`]: ../model/channel/struct.GuildChannel.html#method.messages #[derive(Clone, Debug, Default)] pub struct GetMessages(pub VecMap<&'static str, u64>); diff --git a/src/cache/mod.rs b/src/cache/mod.rs index 4f6d4761111..8cd402eef58 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -16,12 +16,12 @@ //! Most models of Discord objects, such as the [`Message`], [`PublicChannel`], //! or [`Emoji`], have methods for interacting with that single instance. This //! feature is only compiled if the `methods` feature is enabled. An example of -//! this is [`LiveGuild::edit`], which performs a check to ensure that the -//! current user is the owner of the guild, prior to actually performing the -//! HTTP request. The cache is involved due to the function's use of unlocking -//! the cache and retrieving the Id of the current user, and comparing it to -//! the Id of the user that owns the guild. This is an inexpensive method of -//! being able to access data required by these sugary methods. +//! this is [`Guild::edit`], which performs a check to ensure that the current +//! user is the owner of the guild, prior to actually performing the HTTP +//! request. The cache is involved due to the function's use of unlocking the +//! cache and retrieving the Id of the current user, and comparing it to the Id +//! of the user that owns the guild. This is an inexpensive method of being able +//! to access data required by these sugary methods. //! //! # Do I need the Cache? //! @@ -32,13 +32,13 @@ //! while needing to hit the REST API as little as possible, then the answer //! is "yes". //! -//! [`Emoji`]: ../model/struct.Emoji.html -//! [`Group`]: ../model/struct.Group.html -//! [`LiveGuild`]: ../model/struct.LiveGuild.html -//! [`LiveGuild::edit`]: ../model/struct.LiveGuild.html#method.edit -//! [`Message`]: ../model/struct.Message.html -//! [`PublicChannel`]: ../model/struct.PublicChannel.html -//! [`Role`]: ../model/struct.Role.html +//! [`Emoji`]: ../model/guild/struct.Emoji.html +//! [`Group`]: ../model/channel/struct.Group.html +//! [`Guild`]: ../model/guild/struct.Guild.html +//! [`Guild::edit`]: ../model/guild/struct.Guild.html#method.edit +//! [`Message`]: ../model/channel/struct.Message.html +//! [`PublicChannel`]: ../model/channel/struct.PublicChannel.html +//! [`Role`]: ../model/guild/struct.Role.html //! [`CACHE`]: ../struct.CACHE.html //! [`http`]: ../http/index.html @@ -76,7 +76,7 @@ pub struct Cache { /// /// [`Event::GuildDelete`]: ../model/event/struct.GuildDeleteEvent.html /// [`Event::GuildUnavailable`]: ../model/event/struct.GuildUnavailableEvent.html - /// [`Guild`]: ../model/struct.Guild.html + /// [`Guild`]: ../model/guild/struct.Guild.html pub channels: HashMap>>, /// A map of channel categories. pub categories: HashMap>>, @@ -89,8 +89,8 @@ pub struct Cache { /// A map of guilds with full data available. This includes data like /// [`Role`]s and [`Emoji`]s that are not available through the REST API. /// - /// [`Emoji`]: ../model/struct.Emoji.html - /// [`Role`]: ../model/struct.Role.html + /// [`Emoji`]: ../model/guild/struct.Emoji.html + /// [`Role`]: ../model/guild/struct.Role.html pub guilds: HashMap>>, /// A map of notes that a user has made for individual users. /// @@ -115,8 +115,8 @@ pub struct Cache { /// is received. Guilds are "sent in" over time through the receiving of /// [`Event::GuildCreate`]s. /// - /// [`Event::GuildCreate`]: ../model/enum.Event.html#variant.GuildCreate - /// [`Event::GuildUnavailable`]: ../model/enum.Event.html#variant.GuildUnavailable + /// [`Event::GuildCreate`]: ../model/event/enum.Event.html#variant.GuildCreate + /// [`Event::GuildUnavailable`]: ../model/event/enum.Event.html#variant.GuildUnavailable pub unavailable_guilds: HashSet, /// The current user "logged in" and for which events are being received /// for. @@ -126,8 +126,8 @@ pub struct Cache { /// /// Refer to the documentation for [`CurrentUser`] for more information. /// - /// [`CurrentUser`]: ../model/struct.CurrentUser.html - /// [`User`]: ../model/struct.User.html + /// [`CurrentUser`]: ../model/user/struct.CurrentUser.html + /// [`User`]: ../model/user/struct.User.html pub user: CurrentUser, /// A map of users that the current user sees. /// @@ -205,9 +205,9 @@ impl Cache { /// # fn main() { } /// ``` /// - /// [`Member`]: ../model/struct.Member.html + /// [`Member`]: ../model/guild/struct.Member.html /// [`Shard::chunk_guilds`]: ../gateway/struct.Shard.html#method.chunk_guilds - /// [`User`]: ../model/struct.User.html + /// [`User`]: ../model/user/struct.User.html pub fn unknown_members(&self) -> u64 { let mut total = 0; @@ -242,8 +242,8 @@ impl Cache { /// println!("There are {} private channels", amount); /// ``` /// - /// [`Group`]: ../model/struct.Group.html - /// [`PrivateChannel`]: ../model/struct.PrivateChannel.html + /// [`Group`]: ../model/channel/struct.Group.html + /// [`PrivateChannel`]: ../model/channel/struct.PrivateChannel.html pub fn all_private_channels(&self) -> Vec<&ChannelId> { self.groups .keys() @@ -285,7 +285,7 @@ impl Cache { /// ``` /// /// [`Context`]: ../client/struct.Context.html - /// [`Guild`]: ../model/struct.Guild.html + /// [`Guild`]: ../model/guild/struct.Guild.html /// [`Shard`]: ../gateway/struct.Shard.html pub fn all_guilds(&self) -> Vec<&GuildId> { self.guilds @@ -306,9 +306,9 @@ impl Cache { /// - [`PrivateChannel`]: [`private_channel`] or [`private_channels`] /// - [`Group`]: [`group`] or [`groups`] /// - /// [`Channel`]: ../model/enum.Channel.html - /// [`Group`]: ../model/struct.Group.html - /// [`Guild`]: ../model/struct.Guild.html + /// [`Channel`]: ../model/channel/enum.Channel.html + /// [`Group`]: ../model/channel/struct.Group.html + /// [`Guild`]: ../model/guild/struct.Guild.html /// [`channels`]: #structfield.channels /// [`group`]: #method.group /// [`guild_channel`]: #method.guild_channel @@ -338,7 +338,7 @@ impl Cache { /// The only advantage of this method is that you can pass in anything that /// is indirectly a [`GuildId`]. /// - /// [`GuildId`]: ../model/struct.GuildId.html + /// [`GuildId`]: ../model/guild/struct.GuildId.html /// /// # Examples /// @@ -413,9 +413,9 @@ impl Cache { /// # fn main() { } /// ``` /// - /// [`ChannelId`]: ../model/struct.ChannelId.html + /// [`ChannelId`]: ../model/id/struct.ChannelId.html /// [`Client::on_message`]: ../client/struct.Client.html#method.on_message - /// [`Guild`]: ../model/struct.Guild.html + /// [`Guild`]: ../model/guild/struct.Guild.html /// [`channel`]: #method.channel #[inline] pub fn guild_channel>(&self, id: C) -> Option>> { @@ -428,8 +428,8 @@ impl Cache { /// The only advantage of this method is that you can pass in anything that /// is indirectly a [`ChannelId`]. /// - /// [`ChannelId`]: ../model/struct.ChannelId.html - /// [`Group`]: ../model/struct.Group.html + /// [`ChannelId`]: ../model/id/struct.ChannelId.html + /// [`Group`]: ../model/channel/struct.Group.html /// /// # Examples /// @@ -499,8 +499,8 @@ impl Cache { /// ``` /// /// [`Client::on_message`]: ../client/struct.Client.html#method.on_message - /// [`Guild`]: ../model/struct.Guild.html - /// [`members`]: ../model/struct.Guild.html#structfield.members + /// [`Guild`]: ../model/guild/struct.Guild.html + /// [`members`]: ../model/guild/struct.Guild.html#structfield.members pub fn member(&self, guild_id: G, user_id: U) -> Option where G: Into, U: Into { self.guilds.get(&guild_id.into()).and_then(|guild| { @@ -552,8 +552,8 @@ impl Cache { /// **Note**: This will clone the entire role. Instead, retrieve the guild /// and retrieve from the guild's [`roles`] map to avoid this. /// - /// [`Guild`]: ../model/struct.Guild.html - /// [`roles`]: ../model/struct.Guild.html#structfield.roles + /// [`Guild`]: ../model/guild/struct.Guild.html + /// [`roles`]: ../model/guild/struct.Guild.html#structfield.roles /// /// # Examples /// @@ -587,7 +587,7 @@ impl Cache { /// The only advantage of this method is that you can pass in anything that /// is indirectly a [`UserId`]. /// - /// [`UserId`]: ../model/struct.UserId.html + /// [`UserId`]: ../model/user/struct.UserId.html /// [`users`]: #structfield.users /// /// # Examples diff --git a/src/client/bridge/gateway/shard_messenger.rs b/src/client/bridge/gateway/shard_messenger.rs index b2a5ce14ab3..2331d4a56ce 100644 --- a/src/client/bridge/gateway/shard_messenger.rs +++ b/src/client/bridge/gateway/shard_messenger.rs @@ -108,8 +108,8 @@ impl ShardMessenger { /// /// [`Event::GuildMembersChunk`]: /// ../../model/event/enum.Event.html#variant.GuildMembersChunk - /// [`Guild`]: ../../model/struct.Guild.html - /// [`Member`]: ../../model/struct.Member.html + /// [`Guild`]: ../../model/guild/struct.Guild.html + /// [`Member`]: ../../model/guild/struct.Member.html pub fn chunk_guilds( &self, guild_ids: It, @@ -239,9 +239,9 @@ impl ShardMessenger { /// # } /// ``` /// - /// [`DoNotDisturb`]: ../../model/enum.OnlineStatus.html#variant.DoNotDisturb - /// [`Invisible`]: ../../model/enum.OnlineStatus.html#variant.Invisible - /// [`Offline`]: ../../model/enum.OnlineStatus.html#variant.Offline + /// [`DoNotDisturb`]: ../../model/user/enum.OnlineStatus.html#variant.DoNotDisturb + /// [`Invisible`]: ../../model/user/enum.OnlineStatus.html#variant.Invisible + /// [`Offline`]: ../../model/user/enum.OnlineStatus.html#variant.Offline pub fn set_status(&self, mut online_status: OnlineStatus) { if online_status == OnlineStatus::Offline { online_status = OnlineStatus::Invisible; diff --git a/src/client/bridge/gateway/shard_runner_message.rs b/src/client/bridge/gateway/shard_runner_message.rs index d6a18f5346e..d4018b477fb 100644 --- a/src/client/bridge/gateway/shard_runner_message.rs +++ b/src/client/bridge/gateway/shard_runner_message.rs @@ -10,7 +10,7 @@ pub enum ShardRunnerMessage { ChunkGuilds { /// The IDs of the [`Guild`]s to chunk. /// - /// [`Guild`]: ../../../model/struct.Guild.html + /// [`Guild`]: ../../../model/guild/struct.Guild.html guild_ids: Vec, /// The maximum number of members to receive [`GuildMembersChunkEvent`]s /// for. @@ -22,7 +22,7 @@ pub enum ShardRunnerMessage { /// For example, a query of `"s"` will cause only [`Member`]s whose /// usernames start with `"s"` to be chunked. /// - /// [`Member`]: ../../../model/struct.Member.html + /// [`Member`]: ../../../model/guild/struct.Member.html query: Option, }, /// Indicates that the client is to close with the given status code and diff --git a/src/client/context.rs b/src/client/context.rs index f44225f0c3f..6cada3c67d6 100644 --- a/src/client/context.rs +++ b/src/client/context.rs @@ -140,7 +140,7 @@ impl Context { /// client.start().unwrap(); /// ``` /// - /// [`Online`]: ../model/enum.OnlineStatus.html#variant.Online + /// [`Online`]: ../model/user/enum.OnlineStatus.html#variant.Online #[inline] pub fn online(&self) { self.shard.set_status(OnlineStatus::Online); @@ -171,7 +171,7 @@ impl Context { /// client.start().unwrap(); /// ``` /// - /// [`Idle`]: ../model/enum.OnlineStatus.html#variant.Idle + /// [`Idle`]: ../model/user/enum.OnlineStatus.html#variant.Idle #[inline] pub fn idle(&self) { self.shard.set_status(OnlineStatus::Idle); @@ -202,7 +202,7 @@ impl Context { /// client.start().unwrap(); /// ``` /// - /// [`DoNotDisturb`]: ../model/enum.OnlineStatus.html#variant.DoNotDisturb + /// [`DoNotDisturb`]: ../model/user/enum.OnlineStatus.html#variant.DoNotDisturb #[inline] pub fn dnd(&self) { self.shard.set_status(OnlineStatus::DoNotDisturb); @@ -234,7 +234,7 @@ impl Context { /// ``` /// /// [`Event::Ready`]: ../model/event/enum.Event.html#variant.Ready - /// [`Invisible`]: ../model/enum.OnlineStatus.html#variant.Invisible + /// [`Invisible`]: ../model/user/enum.OnlineStatus.html#variant.Invisible #[inline] pub fn invisible(&self) { self.shard.set_status(OnlineStatus::Invisible); @@ -267,7 +267,7 @@ impl Context { /// ``` /// /// [`Event::Resumed`]: ../model/event/enum.Event.html#variant.Resumed - /// [`Online`]: ../model/enum.OnlineStatus.html#variant.Online + /// [`Online`]: ../model/user/enum.OnlineStatus.html#variant.Online /// [`set_presence`]: #method.set_presence #[inline] pub fn reset_presence(&self) { @@ -312,7 +312,7 @@ impl Context { /// # fn main() {} /// ``` /// - /// [`Online`]: ../model/enum.OnlineStatus.html#variant.Online + /// [`Online`]: ../model/user/enum.OnlineStatus.html#variant.Online #[inline] pub fn set_game(&self, game: Game) { self.shard.set_presence(Some(game), OnlineStatus::Online); @@ -348,10 +348,10 @@ impl Context { /// ``` /// /// [`Event::Ready`]: ../model/event/enum.Event.html#variant.Ready - /// [`GameType`]: ../model/enum.GameType.html - /// [`Online`]: ../model/enum.OnlineStatus.html#variant.Online - /// [`OnlineStatus`]: ../model/enum.OnlineStatus.html - /// [`Playing`]: ../model/enum.GameType.html#variant.Playing + /// [`GameType`]: ../model/gateway/enum.GameType.html + /// [`Online`]: ../model/user/enum.OnlineStatus.html#variant.Online + /// [`OnlineStatus`]: ../model/user/enum.OnlineStatus.html + /// [`Playing`]: ../model/gateway/enum.GameType.html#variant.Playing /// [`reset_presence`]: #method.reset_presence /// [`set_presence`]: #method.set_presence pub fn set_game_name(&self, game_name: &str) { @@ -414,8 +414,8 @@ impl Context { /// client.start().unwrap(); /// ``` /// - /// [`DoNotDisturb`]: ../model/enum.OnlineStatus.html#variant.DoNotDisturb - /// [`Idle`]: ../model/enum.OnlineStatus.html#variant.Idle + /// [`DoNotDisturb`]: ../model/user/enum.OnlineStatus.html#variant.DoNotDisturb + /// [`Idle`]: ../model/user/enum.OnlineStatus.html#variant.Idle #[inline] pub fn set_presence(&self, game: Option, status: OnlineStatus) { self.shard.set_presence(game, status); diff --git a/src/client/error.rs b/src/client/error.rs index 23c9ad96ee1..8790a17d207 100644 --- a/src/client/error.rs +++ b/src/client/error.rs @@ -9,7 +9,7 @@ use std::fmt::{Display, Formatter, Result as FmtResult}; /// [`Client`]: struct.Client.html /// [`Error`]: ../enum.Error.html /// [`Error::Client`]: ../enum.Error.html#variant.Client -/// [`GuildId::ban`]: ../model/struct.GuildId.html#method.ban +/// [`GuildId::ban`]: ../model/id/struct.GuildId.html#method.ban #[allow(enum_variant_names)] #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub enum Error { diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index 22fb186d61d..da87c611576 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -717,8 +717,8 @@ impl Shard { /// /// [`Event::GuildMembersChunk`]: /// ../../model/event/enum.Event.html#variant.GuildMembersChunk - /// [`Guild`]: ../../model/struct.Guild.html - /// [`Member`]: ../../model/struct.Member.html + /// [`Guild`]: ../../model/guild/struct.Guild.html + /// [`Member`]: ../../model/guild/struct.Member.html pub fn chunk_guilds( &mut self, guild_ids: It, diff --git a/src/http/mod.rs b/src/http/mod.rs index b1a837902a9..6b56abda2f9 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -105,9 +105,9 @@ pub fn set_token(token: &str) { TOKEN.lock().clone_from(&token.to_string()); } /// /// **Note**: Groups have a limit of 10 recipients, including the current user. /// -/// [`Group`]: ../model/struct.Group.html -/// [`Group::add_recipient`]: ../model/struct.Group.html#method.add_recipient -/// [`User`]: ../model/struct.User.html +/// [`Group`]: ../model/channel/struct.Group.html +/// [`Group::add_recipient`]: ../model/channel/struct.Group.html#method.add_recipient +/// [`User`]: ../model/user/struct.User.html pub fn add_group_recipient(group_id: u64, user_id: u64) -> Result<()> { verify( 204, @@ -126,9 +126,9 @@ pub fn add_group_recipient(group_id: u64, user_id: u64) -> Result<()> { /// **Note**: Requires the [Manage Roles] permission and respect of role /// hierarchy. /// -/// [`Guild`]: ../model/struct.Guild.html -/// [`Member`]: ../model/struct.Member.html -/// [`Role`]: ../model/struct.Role.html +/// [`Guild`]: ../model/guild/struct.Guild.html +/// [`Member`]: ../model/guild/struct.Member.html +/// [`Role`]: ../model/guild/struct.Role.html /// [Manage Roles]: ../model/permissions/constant.MANAGE_ROLES.html pub fn add_member_role(guild_id: u64, user_id: u64, role_id: u64) -> Result<()> { verify( @@ -152,8 +152,8 @@ pub fn add_member_role(guild_id: u64, user_id: u64, role_id: u64) -> Result<()> /// /// **Note**: Requires that you have the [Ban Members] permission. /// -/// [`Guild`]: ../model/struct.Guild.html -/// [`User`]: ../model/struct.User.html +/// [`Guild`]: ../model/guild/struct.Guild.html +/// [`User`]: ../model/user/struct.User.html /// [Ban Members]: ../model/permissions/constant.BAN_MEMBERS.html pub fn ban_user(guild_id: u64, user_id: u64, delete_message_days: u8, reason: &str) -> Result<()> { verify( @@ -178,7 +178,7 @@ pub fn ban_user(guild_id: u64, user_id: u64, delete_message_days: u8, reason: &s /// This should rarely be used for bots, although it is a good indicator that a /// long-running command is still being processed. /// -/// [`Channel`]: ../model/enum.Channel.html +/// [`Channel`]: ../model/channel/enum.Channel.html pub fn broadcast_typing(channel_id: u64) -> Result<()> { verify( 204, @@ -197,8 +197,8 @@ pub fn broadcast_typing(channel_id: u64) -> Result<()> { /// /// **Note**: Requires the [Manage Channels] permission. /// -/// [`Guild`]: ../model/struct.Guild.html -/// [`GuildChannel`]: ../model/struct.GuildChannel.html +/// [`Guild`]: ../model/guild/struct.Guild.html +/// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html /// [docs]: https://discordapp.com/developers/docs/resources/guild#create-guild-channel /// [Manage Channels]: ../model/permissions/constant.MANAGE_CHANNELS.html pub fn create_channel(guild_id: u64, map: &Value) -> Result { @@ -222,7 +222,7 @@ pub fn create_channel(guild_id: u64, map: &Value) -> Result { /// **Note**: Requires the [Manage Emojis] permission. /// /// [`Context::create_emoji`]: ../struct.Context.html#method.create_emoji -/// [`Guild`]: ../model/struct.Guild.html +/// [`Guild`]: ../model/guild/struct.Guild.html /// [Manage Emojis]: ../model/permissions/constant.MANAGE_EMOJIS.html pub fn create_emoji(guild_id: u64, map: &Value) -> Result { let body = map.to_string(); @@ -265,11 +265,11 @@ pub fn create_emoji(guild_id: u64, map: &Value) -> Result { /// let _result = http::create_guild(map); /// ``` /// -/// [`Guild`]: ../model/struct.Guild.html -/// [`PartialGuild`]: ../model/struct.PartialGuild.html +/// [`Guild`]: ../model/guild/struct.Guild.html +/// [`PartialGuild`]: ../model/guild/struct.PartialGuild.html /// [`Shard`]: ../gateway/struct.Shard.html /// [GameBridge]: https://discordapp.com/developers/docs/topics/gamebridge -/// [US West Region]: ../model/enum.Region.html#variant.UsWest +/// [US West Region]: ../model/guild/enum.Region.html#variant.UsWest /// [documentation on this endpoint]: /// https://discordapp.com/developers/docs/resources/guild#create-guild /// [whitelist]: https://discordapp.com/developers/docs/resources/guild#create-guild @@ -287,8 +287,8 @@ pub fn create_guild(map: &Value) -> Result { /// /// **Note**: Requires the [Manage Guild] permission. /// -/// [`Guild`]: ../model/struct.Guild.html -/// [`Integration`]: ../model/struct.Integration.html +/// [`Guild`]: ../model/guild/struct.Guild.html +/// [`Integration`]: ../model/guild/struct.Integration.html /// [Manage Guild]: ../model/permissions/constant.MANAGE_GUILD.html /// [docs]: https://discordapp.com/developers/docs/resources/guild#create-guild-integration pub fn create_guild_integration(guild_id: u64, integration_id: u64, map: &Value) -> Result<()> { @@ -314,8 +314,8 @@ pub fn create_guild_integration(guild_id: u64, integration_id: u64, map: &Value) /// /// **Note**: Requires the [Create Invite] permission. /// -/// [`GuildChannel`]: ../model/struct.GuildChannel.html -/// [`RichInvite`]: ../model/struct.RichInvite.html +/// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html +/// [`RichInvite`]: ../model/guild/struct.RichInvite.html /// [Create Invite]: ../model/permissions/constant.CREATE_INVITE.html /// [docs]: https://discordapp.com/developers/docs/resources/channel#create-channel-invite pub fn create_invite(channel_id: u64, map: &JsonMap) -> Result { @@ -417,7 +417,7 @@ pub fn create_role(guild_id: u64, map: &JsonMap) -> Result { /// let webhook = http::create_webhook(channel_id, map).expect("Error creating"); /// ``` /// -/// [`GuildChannel`]: ../model/struct.GuildChannel.html +/// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html pub fn create_webhook(channel_id: u64, map: &Value) -> Result { let body = map.to_string(); let response = request!( @@ -533,8 +533,8 @@ pub fn delete_messages(channel_id: u64, map: &Value) -> Result<()> { /// .expect("Error deleting reactions"); /// ``` /// -/// [`Message`]: ../model/struct.Message.html -/// [`Reaction`]: ../model/struct.Reaction.html +/// [`Message`]: ../model/channel/struct.Message.html +/// [`Reaction`]: ../model/channel/struct.Reaction.html pub fn delete_message_reactions(channel_id: u64, message_id: u64) -> Result<()> { verify( 204, @@ -621,7 +621,7 @@ pub fn delete_role(guild_id: u64, role_id: u64) -> Result<()> { /// http::delete_webhook(245037420704169985).expect("Error deleting webhook"); /// ``` /// -/// [`Webhook`]: ../model/struct.Webhook.html +/// [`Webhook`]: ../model/webhook/struct.Webhook.html /// [`delete_webhook_with_token`]: fn.delete_webhook_with_token.html pub fn delete_webhook(webhook_id: u64) -> Result<()> { verify( @@ -652,7 +652,7 @@ pub fn delete_webhook(webhook_id: u64) -> Result<()> { /// http::delete_webhook_with_token(id, token).expect("Error deleting webhook"); /// ``` /// -/// [`Webhook`]: ../model/struct.Webhook.html +/// [`Webhook`]: ../model/webhook/struct.Webhook.html pub fn delete_webhook_with_token(webhook_id: u64, token: &str) -> Result<()> { let client = request_client!(); @@ -726,7 +726,7 @@ pub fn edit_guild_channel_positions(guild_id: u64, value: &Value) /// Edits a [`Guild`]'s embed setting. /// -/// [`Guild`]: ../model/struct.Guild.html +/// [`Guild`]: ../model/guild/struct.Guild.html pub fn edit_guild_embed(guild_id: u64, map: &Value) -> Result { let body = map.to_string(); let response = request!( @@ -777,7 +777,7 @@ pub fn edit_message(channel_id: u64, message_id: u64, map: &Value) -> Result) -> Result<()> { let map = json!({ "nick": new_nickname }); let body = map.to_string(); @@ -1003,8 +1003,8 @@ pub fn edit_webhook_with_token(webhook_id: u64, token: &str, map: &JsonMap) -> R /// }; /// ``` /// -/// [`Channel`]: ../model/enum.Channel.html -/// [`Message`]: ../model/struct.Message.html +/// [`Channel`]: ../model/channel/enum.Channel.html +/// [`Message`]: ../model/channel/struct.Message.html /// [Discord docs]: https://discordapp.com/developers/docs/resources/webhook#querystring-params pub fn execute_webhook(webhook_id: u64, token: &str, @@ -1129,7 +1129,7 @@ pub fn get_channel_invites(channel_id: u64) -> Result> { /// .expect("Error getting channel webhooks"); /// ``` /// -/// [`GuildChannel`]: ../model/struct.GuildChannel.html +/// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html pub fn get_channel_webhooks(channel_id: u64) -> Result> { let response = request!( Route::ChannelsIdWebhooks(channel_id), @@ -1285,10 +1285,8 @@ pub fn get_guild_prune_count(guild_id: u64, map: &Value) -> Result { .map_err(From::from) } -/// Gets regions that a guild can use. If a guild has [`Feature::VipRegions`] +/// Gets regions that a guild can use. If a guild has the `VIP_REGIONS` feature /// enabled, then additional VIP-only regions are returned. -/// -/// [`Feature::VipRegions`]: ../model/enum.Feature.html#variant.VipRegions pub fn get_guild_regions(guild_id: u64) -> Result> { let response = request!( Route::GuildsIdRegions(guild_id), @@ -1303,7 +1301,7 @@ pub fn get_guild_regions(guild_id: u64) -> Result> { /// Retrieves a list of roles in a [`Guild`]. /// -/// [`Guild`]: ../model/struct.Guild.html +/// [`Guild`]: ../model/guild/struct.Guild.html pub fn get_guild_roles(guild_id: u64) -> Result> { let response = request!( Route::GuildsIdRoles(guild_id), @@ -1333,7 +1331,7 @@ pub fn get_guild_roles(guild_id: u64) -> Result> { /// .expect("Error getting guild webhooks"); /// ``` /// -/// [`Guild`]: ../model/struct.Guild.html +/// [`Guild`]: ../model/guild/struct.Guild.html pub fn get_guild_webhooks(guild_id: u64) -> Result> { let response = request!( Route::GuildsIdWebhooks(guild_id), @@ -1778,9 +1776,9 @@ pub fn remove_ban(guild_id: u64, user_id: u64) -> Result<()> { /// **Note**: Requires the [Manage Roles] permission and respect of role /// hierarchy. /// -/// [`Guild`]: ../model/struct.Guild.html -/// [`Member`]: ../model/struct.Member.html -/// [`Role`]: ../model/struct.Role.html +/// [`Guild`]: ../model/guild/struct.Guild.html +/// [`Member`]: ../model/guild/struct.Member.html +/// [`Role`]: ../model/guild/struct.Role.html /// [Manage Roles]: ../model/permissions/constant.MANAGE_ROLES.html pub fn remove_member_role(guild_id: u64, user_id: u64, role_id: u64) -> Result<()> { verify( diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs index 498dc7ae7ba..ca269e364e9 100644 --- a/src/http/ratelimiting.rs +++ b/src/http/ratelimiting.rs @@ -104,31 +104,31 @@ pub enum Route { /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsId(u64), /// Route for the `/channels/:channel_id/invites` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdInvites(u64), /// Route for the `/channels/:channel_id/messages` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdMessages(u64), /// Route for the `/channels/:channel_id/messages/bulk-delete` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdMessagesBulkDelete(u64), /// Route for the `/channels/:channel_id/messages/:message_id` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html // This route is a unique case. The ratelimit for message _deletions_ is // different than the overall route ratelimit. // @@ -143,14 +143,14 @@ pub enum Route { /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdMessagesIdAck(u64), /// Route for the `/channels/:channel_id/messages/:message_id/reactions` /// path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdMessagesIdReactions(u64), /// Route for the /// `/channels/:channel_id/messages/:message_id/reactions/:reaction/@me` @@ -158,37 +158,37 @@ pub enum Route { /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdMessagesIdReactionsUserIdType(u64), /// Route for the `/channels/:channel_id/permissions/:target_id` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdPermissionsOverwriteId(u64), /// Route for the `/channels/:channel_id/pins` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdPins(u64), /// Route for the `/channels/:channel_id/pins/:message_id` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdPinsMessageId(u64), /// Route for the `/channels/:channel_id/typing` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdTyping(u64), /// Route for the `/channels/:channel_id/webhooks` path. /// /// The data is the relevant [`ChannelId`]. /// - /// [`ChannelId`]: ../../model/struct.ChannelId.html + /// [`ChannelId`]: ../../model/id/struct.ChannelId.html ChannelsIdWebhooks(u64), /// Route for the `/gateway` path. Gateway, diff --git a/src/model/channel/group.rs b/src/model/channel/group.rs index 840234de88e..61fe67e518a 100644 --- a/src/model/channel/group.rs +++ b/src/model/channel/group.rs @@ -276,7 +276,7 @@ impl Group { /// is over the above limit, containing the number of unicode code points /// over the limit. /// - /// [`ChannelId`]: ../model/struct.ChannelId.html + /// [`ChannelId`]: ../model/id/struct.ChannelId.html /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong #[inline] pub fn say(&self, content: &str) -> Result { self.channel_id.say(content) } diff --git a/src/model/channel/private_channel.rs b/src/model/channel/private_channel.rs index f22a2258e2e..7c8b1e8d3d9 100644 --- a/src/model/channel/private_channel.rs +++ b/src/model/channel/private_channel.rs @@ -221,7 +221,7 @@ impl PrivateChannel { /// is over the above limit, containing the number of unicode code points /// over the limit. /// - /// [`ChannelId`]: ../model/struct.ChannelId.html + /// [`ChannelId`]: ../model/id/struct.ChannelId.html /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong #[inline] pub fn say(&self, content: D) -> Result { self.id.say(content) } diff --git a/src/model/error.rs b/src/model/error.rs index a2b8325e705..ea919bcd697 100644 --- a/src/model/error.rs +++ b/src/model/error.rs @@ -82,8 +82,8 @@ pub enum Error { /// An indication that a [guild][`Guild`] could not be found by /// [Id][`GuildId`] in the [`Cache`]. /// - /// [`Guild`]: ../model/struct.Guild.html - /// [`GuildId`]: ../model/struct.GuildId.html + /// [`Guild`]: ../model/guild/struct.Guild.html + /// [`GuildId`]: ../model/id/struct.GuildId.html /// [`Cache`]: ../cache/struct.Cache.html GuildNotFound, /// Indicates that there are hierarchy problems restricting an action. @@ -104,7 +104,7 @@ pub enum Error { InvalidPermissions(Permissions), /// An indicator that the [current user] can not perform an action. /// - /// [current user]: ../model/struct.CurrentUser.html + /// [current user]: ../model/user/struct.CurrentUser.html InvalidUser, /// An indicator that an item is missing from the [`Cache`], and the action /// can not be continued. @@ -116,7 +116,7 @@ pub enum Error { /// /// The number of bytes larger than the limit is provided. /// - /// [`Message`]: ../model/struct.Message.html + /// [`Message`]: ../model/channel/struct.Message.html MessageTooLong(u64), /// Indicates that the current user is attempting to Direct Message another /// bot user, which is disallowed by the API. diff --git a/src/model/guild/member.rs b/src/model/guild/member.rs index 3b0147be375..cbc6066f230 100644 --- a/src/model/guild/member.rs +++ b/src/model/guild/member.rs @@ -224,7 +224,7 @@ impl Member { /// See [`EditMember`] for the permission(s) required for separate builder /// methods, as well as usage of this. /// - /// [`Guild::edit_member`]: ../model/struct.Guild.html#method.edit_member + /// [`Guild::edit_member`]: ../model/guild/struct.Guild.html#method.edit_member /// [`EditMember`]: ../builder/struct.EditMember.html #[cfg(feature = "cache")] pub fn edit EditMember>(&self, f: F) -> Result<()> { diff --git a/src/utils/colour.rs b/src/utils/colour.rs index c59f4bef426..77a1ce71b4c 100644 --- a/src/utils/colour.rs +++ b/src/utils/colour.rs @@ -75,7 +75,7 @@ macro_rules! colour { /// assert!(blitz_blue > fooyoo); /// ``` /// -/// [`Role`]: ../model/struct.Role.html +/// [`Role`]: ../model/guild/struct.Role.html /// [`dark_teal`]: #method.dark_teal /// [`g`]: #method.g #[derive(Clone, Copy, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)] diff --git a/src/utils/message_builder.rs b/src/utils/message_builder.rs index f7dcae13e27..b034e6a68cc 100644 --- a/src/utils/message_builder.rs +++ b/src/utils/message_builder.rs @@ -121,10 +121,10 @@ impl MessageBuilder { /// assert_eq!(content, "The channel is: <#81384788765712384>"); /// ``` /// - /// [`Channel`]: ../model/enum.Channel.html - /// [`ChannelId`]: ../model/struct.ChannelId.html - /// [`GuildChannel`]: ../model/struct.GuildChannel.html - /// [Display implementation]: ../model/struct.ChannelId.html#method.fmt-1 + /// [`Channel`]: ../model/channel/enum.Channel.html + /// [`ChannelId`]: ../model/id/struct.ChannelId.html + /// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html + /// [Display implementation]: ../model/id/struct.ChannelId.html#method.fmt-1 pub fn channel>(mut self, channel: C) -> Self { let _ = write!(self.0, "{}", channel.into().mention()); @@ -163,7 +163,7 @@ impl MessageBuilder { /// assert_eq!(message, "foo <:smugAnimeFace:302516740095606785>."); /// ``` /// - /// [Display implementation]: ../model/struct.Emoji.html#method.fmt + /// [Display implementation]: ../model/guild/struct.Emoji.html#method.fmt pub fn emoji(mut self, emoji: &Emoji) -> Self { let _ = write!(self.0, "{}", emoji); @@ -703,9 +703,9 @@ impl MessageBuilder { /// Refer to `RoleId`'s [Display implementation] for more information on how /// this is formatted. /// - /// [`Role`]: ../model/struct.Role.html - /// [`RoleId`]: ../model/struct.RoleId.html - /// [Display implementation]: ../model/struct.RoleId.html#method.fmt-1 + /// [`Role`]: ../model/guild/struct.Role.html + /// [`RoleId`]: ../model/id/struct.RoleId.html + /// [Display implementation]: ../model/id/struct.RoleId.html#method.fmt-1 pub fn role>(mut self, role: R) -> Self { let _ = write!(self.0, "{}", role.into().mention()); @@ -720,9 +720,9 @@ impl MessageBuilder { /// Refer to `UserId`'s [Display implementation] for more information on how /// this is formatted. /// - /// [`User`]: ../model/struct.User.html - /// [`UserId`]: ../model/struct.UserId.html - /// [Display implementation]: ../model/struct.UserId.html#method.fmt-1 + /// [`User`]: ../model/user/struct.User.html + /// [`UserId`]: ../model/id/struct.UserId.html + /// [Display implementation]: ../model/id/struct.UserId.html#method.fmt-1 pub fn user>(mut self, user: U) -> Self { let _ = write!(self.0, "{}", user.into().mention()); diff --git a/src/utils/mod.rs b/src/utils/mod.rs index afd5b59d6dc..de75632501b 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -137,7 +137,7 @@ pub fn is_nsfw(name: &str) -> bool { /// assert_eq!(utils::parse_invite(url), "0cDvIgU2voY8RSYL"); /// ``` /// -/// [`RichInvite`]: ../model/struct.RichInvite.html +/// [`RichInvite`]: ../model/guild/struct.RichInvite.html pub fn parse_invite(code: &str) -> &str { if code.starts_with("https://discord.gg/") { &code[19..] @@ -177,7 +177,7 @@ pub fn parse_invite(code: &str) -> &str { /// assert!(parse_username("<@!11494131541789a90b1c2").is_none()); /// ``` /// -/// [`User`]: ../model/struct.User.html +/// [`User`]: ../model/user/struct.User.html pub fn parse_username(mention: &str) -> Option { if mention.len() < 4 { return None; @@ -216,7 +216,7 @@ pub fn parse_username(mention: &str) -> Option { /// assert!(parse_role("<@&136107769680887808").is_none()); /// ``` /// -/// [`Role`]: ../model/struct.Role.html +/// [`Role`]: ../model/guild/struct.Role.html pub fn parse_role(mention: &str) -> Option { if mention.len() < 4 { return None; @@ -253,7 +253,7 @@ pub fn parse_role(mention: &str) -> Option { /// assert!(parse_channel("<#81384788765712384").is_none()); /// ``` /// -/// [`Channel`]: ../model/enum.Channel.html +/// [`Channel`]: ../model/channel/enum.Channel.html pub fn parse_channel(mention: &str) -> Option { if mention.len() < 4 { return None; @@ -297,7 +297,7 @@ pub fn parse_channel(mention: &str) -> Option { /// assert!(parse_emoji("<:smugAnimeFace:302516740095606785").is_none()); /// ``` /// -/// [`Emoji`]: ../model/struct.Emoji.html +/// [`Emoji`]: ../model/guild/struct.Emoji.html pub fn parse_emoji(mention: &str) -> Option { let len = mention.len(); diff --git a/src/voice/handler.rs b/src/voice/handler.rs index 8113d9428f4..82e117c8f5f 100644 --- a/src/voice/handler.rs +++ b/src/voice/handler.rs @@ -40,25 +40,16 @@ use super::{Audio, AudioReceiver, AudioSource, Status as VoiceStatus, threading, pub struct Handler { /// The ChannelId to be connected to, if any. /// - /// Note that when connected to a voice channel, while the `ChannelId` will - /// not be `None`, the [`guild_id`] can, in the event of [`Group`] or - /// 1-on-1 [`Call`]s. - /// /// **Note**: This _must not_ be manually mutated. Call [`switch_to`] to /// mutate this value. /// - /// [`Call`]: ../../model/struct.Call.html - /// [`Group`]: ../../model/struct.Group.html + /// [`Group`]: ../../model/channel/struct.Group.html /// [`guild`]: #structfield.guild /// [`switch_to`]: #method.switch_to pub channel_id: Option, /// The voice server endpoint. pub endpoint: Option, - /// The GuildId to be connected to, if any. Can be normally `None` in the - /// event of playing audio to a one-on-one [`Call`] or [`Group`]. - /// - /// [`Call`]: ../../model/struct.Call.html - /// [`Group`]: ../../model/struct.Group.html + /// The Id of the guild to be connected to. pub guild_id: GuildId, /// Whether the current handler is set to deafen voice connections. /// @@ -193,11 +184,6 @@ impl Handler { } /// Connect - or switch - to the given voice channel by its Id. - /// - /// **Note**: This is not necessary for [`Group`] or direct [call][`Call`]s. - /// - /// [`Call`]: ../../model/struct.Call.html - /// [`Group`]: ../../model/struct.Group.html pub fn join(&mut self, channel_id: ChannelId) { self.channel_id = Some(channel_id); diff --git a/src/voice/manager.rs b/src/voice/manager.rs index 79f469ae8e2..b4b36b0d5b9 100644 --- a/src/voice/manager.rs +++ b/src/voice/manager.rs @@ -16,9 +16,9 @@ use super::Handler; /// If a `guild_id` is provided, then the target is the guild, as a user /// can not be connected to two channels within one guild simultaneously. /// -/// [`Group`]: ../../model/struct.Group.html +/// [`Group`]: ../../model/channel/struct.Group.html /// [`Handler`]: struct.Handler.html -/// [guild's channel]: ../../model/enum.ChannelType.html#variant.Voice +/// [guild's channel]: ../../model/channel/enum.ChannelType.html#variant.Voice /// [`Shard`]: ../gateway/struct.Shard.html #[derive(Clone, Debug)] pub struct Manager {