aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErk- <[email protected]>2018-08-09 20:34:33 +0200
committerzeyla <[email protected]>2018-08-09 11:34:33 -0700
commit40053a71931bb63c43eb6f469ee3c94383c9e90a (patch)
tree79c2fabc1229d0543205bc6daf8ebebc6ebc9755
parent[routing] Fix various incorrect routes. (#364) (diff)
downloadserenity-40053a71931bb63c43eb6f469ee3c94383c9e90a.tar.xz
serenity-40053a71931bb63c43eb6f469ee3c94383c9e90a.zip
Fix all the dead links in the docs
-rw-r--r--src/builder/create_invite.rs4
-rw-r--r--src/builder/edit_guild.rs2
-rw-r--r--src/builder/edit_member.rs10
-rw-r--r--src/builder/edit_profile.rs2
-rw-r--r--src/cache/mod.rs10
-rw-r--r--src/client/bridge/gateway/mod.rs9
-rw-r--r--src/client/bridge/gateway/shard_manager_monitor.rs2
-rw-r--r--src/client/bridge/gateway/shard_messenger.rs13
-rw-r--r--src/client/bridge/gateway/shard_runner_message.rs2
-rw-r--r--src/client/bridge/mod.rs2
-rw-r--r--src/client/mod.rs23
-rw-r--r--src/constants.rs2
-rw-r--r--src/framework/standard/configuration.rs4
-rw-r--r--src/framework/standard/mod.rs25
-rw-r--r--src/gateway/mod.rs21
-rw-r--r--src/gateway/shard.rs13
-rw-r--r--src/http/mod.rs30
-rw-r--r--src/http/ratelimiting.rs6
-rw-r--r--src/http/routing.rs44
-rw-r--r--src/lib.rs2
-rw-r--r--src/model/application.rs2
-rw-r--r--src/model/channel/attachment.rs4
-rw-r--r--src/model/channel/channel_category.rs2
-rw-r--r--src/model/channel/channel_id.rs92
-rw-r--r--src/model/channel/embed.rs2
-rw-r--r--src/model/channel/group.rs52
-rw-r--r--src/model/channel/guild_channel.rs87
-rw-r--r--src/model/channel/message.rs51
-rw-r--r--src/model/channel/mod.rs48
-rw-r--r--src/model/channel/private_channel.rs46
-rw-r--r--src/model/channel/reaction.rs30
-rw-r--r--src/model/error.rs22
-rw-r--r--src/model/event.rs11
-rw-r--r--src/model/gateway.rs6
-rw-r--r--src/model/guild/emoji.rs5
-rw-r--r--src/model/guild/guild_id.rs103
-rw-r--r--src/model/guild/member.rs35
-rw-r--r--src/model/guild/mod.rs107
-rw-r--r--src/model/guild/partial_guild.rs64
-rw-r--r--src/model/guild/role.rs8
-rw-r--r--src/model/id.rs2
-rw-r--r--src/model/invite.rs38
-rw-r--r--src/model/permissions.rs24
-rw-r--r--src/model/user.rs26
-rw-r--r--src/model/webhook.rs14
-rw-r--r--src/utils/mod.rs2
46 files changed, 551 insertions, 558 deletions
diff --git a/src/builder/create_invite.rs b/src/builder/create_invite.rs
index c9b00ff..c38924b 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/guild/struct.GuildChannel.html#method.create_invite
-/// [`RichInvite`]: ../model/guild/struct.Invite.html
+/// [`GuildChannel::create_invite`]: ../model/channel/struct.GuildChannel.html#method.create_invite
+/// [`RichInvite`]: ../model/invite/struct.RichInvite.html
#[derive(Clone, Debug)]
pub struct CreateInvite(pub VecMap<&'static str, Value>);
diff --git a/src/builder/edit_guild.rs b/src/builder/edit_guild.rs
index 28abda7..5db2051 100644
--- a/src/builder/edit_guild.rs
+++ b/src/builder/edit_guild.rs
@@ -10,7 +10,7 @@ use utils::VecMap;
///
/// [`Guild::edit`]: ../model/guild/struct.Guild.html#method.edit
/// [`Guild`]: ../model/guild/struct.Guild.html
-/// [Manage Guild]: ../model/permissions/constant.MANAGE_GUILD.html
+/// [Manage Guild]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD
#[derive(Clone, Debug, Default)]
pub struct EditGuild(pub VecMap<&'static str, Value>);
diff --git a/src/builder/edit_member.rs b/src/builder/edit_member.rs
index c0791d6..0fba010 100644
--- a/src/builder/edit_member.rs
+++ b/src/builder/edit_member.rs
@@ -15,7 +15,7 @@ impl EditMember {
///
/// Requires the [Deafen Members] permission.
///
- /// [Deafen Members]: ../model/permissions/constant.DEAFEN_MEMBERS.html
+ /// [Deafen Members]: ../model/permissions/struct.Permissions.html#associatedconstant.DEAFEN_MEMBERS
pub fn deafen(mut self, deafen: bool) -> Self {
self.0.insert("deaf", Value::Bool(deafen));
@@ -26,7 +26,7 @@ impl EditMember {
///
/// Requires the [Mute Members] permission.
///
- /// [Mute Members]: ../model/permissions/constant.MUTE_MEMBERS.html
+ /// [Mute Members]: ../model/permissions/struct.Permissions.html#associatedconstant.MUTE_MEMBERS
pub fn mute(mut self, mute: bool) -> Self {
self.0.insert("mute", Value::Bool(mute));
@@ -38,7 +38,7 @@ impl EditMember {
///
/// Requires the [Manage Nicknames] permission.
///
- /// [Manage Nicknames]: ../model/permissions/constant.MANAGE_NICKNAMES.html
+ /// [Manage Nicknames]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_NICKNAMES
pub fn nickname(mut self, nickname: &str) -> Self {
self.0.insert("nick", Value::String(nickname.to_string()));
@@ -49,7 +49,7 @@ impl EditMember {
///
/// Requires the [Manage Roles] permission to modify.
///
- /// [Manage Roles]: ../model/permissions/constant.MANAGE_ROLES.html
+ /// [Manage Roles]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES
pub fn roles<T: AsRef<RoleId>, It: IntoIterator<Item=T>>(self, roles: It) -> Self {
let roles = roles
.into_iter()
@@ -69,7 +69,7 @@ impl EditMember {
///
/// Requires the [Move Members] permission.
///
- /// [Move Members]: ../model/permissions/constant.MOVE_MEMBERS.html
+ /// [Move Members]: ../model/permissions/struct.Permissions.html#associatedconstant.MOVE_MEMBERS
#[inline]
pub fn voice_channel<C: Into<ChannelId>>(self, channel_id: C) -> Self {
self._voice_channel(channel_id.into())
diff --git a/src/builder/edit_profile.rs b/src/builder/edit_profile.rs
index df428b4..5bc0b92 100644
--- a/src/builder/edit_profile.rs
+++ b/src/builder/edit_profile.rs
@@ -45,7 +45,7 @@ impl EditProfile {
/// # client.start().unwrap();
/// ```
///
- /// [`utils::read_image`]: ../fn.read_image.html
+ /// [`utils::read_image`]: ../utils/fn.read_image.html
pub fn avatar(mut self, avatar: Option<&str>) -> Self {
let avatar = avatar.map_or(Value::Null, |x| Value::String(x.to_string()));
self.0.insert("avatar", avatar);
diff --git a/src/cache/mod.rs b/src/cache/mod.rs
index b97855e..780c364 100644
--- a/src/cache/mod.rs
+++ b/src/cache/mod.rs
@@ -13,7 +13,7 @@
//!
//! # Use by Models
//!
-//! Most models of Discord objects, such as the [`Message`], [`PublicChannel`],
+//! Most models of Discord objects, such as the [`Message`], [`GuildChannel`],
//! 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 [`Guild::edit`], which performs a check to ensure that the current
@@ -37,7 +37,7 @@
//! [`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
+//! [`GuildChannel`]: ../model/channel/struct.GuildChannel.html
//! [`Role`]: ../model/guild/struct.Role.html
//! [`CACHE`]: ../struct.CACHE.html
//! [`http`]: ../http/index.html
@@ -154,7 +154,6 @@ pub struct Cache {
/// - [`GuildMemberAdd`][`GuildMemberAddEvent`]
/// - [`GuildMemberRemove`][`GuildMemberRemoveEvent`]
/// - [`GuildMembersChunk`][`GuildMembersChunkEvent`]
- /// - [`GuildSync`][`GuildSyncEvent`]
/// - [`PresenceUpdate`][`PresenceUpdateEvent`]
/// - [`Ready`][`ReadyEvent`]
///
@@ -167,7 +166,6 @@ pub struct Cache {
/// [`GuildMemberRemoveEvent`]: ../model/event/struct.GuildMemberRemoveEvent.html
/// [`GuildMemberUpdateEvent`]: ../model/event/struct.GuildMemberUpdateEvent.html
/// [`GuildMembersChunkEvent`]: ../model/event/struct.GuildMembersChunkEvent.html
- /// [`GuildSyncEvent`]: ../model/event/struct.GuildSyncEvent.html
/// [`PresenceUpdateEvent`]: ../model/event/struct.PresenceUpdateEvent.html
/// [`ReadyEvent`]: ../model/event/struct.ReadyEvent.html
pub users: HashMap<UserId, Arc<RwLock<User>>>,
@@ -391,7 +389,7 @@ impl Cache {
/// The only advantage of this method is that you can pass in anything that
/// is indirectly a [`GuildId`].
///
- /// [`GuildId`]: ../model/guild/struct.GuildId.html
+ /// [`GuildId`]: ../model/id/struct.GuildId.html
///
/// # Examples
///
@@ -700,7 +698,7 @@ impl Cache {
/// The only advantage of this method is that you can pass in anything that
/// is indirectly a [`UserId`].
///
- /// [`UserId`]: ../model/user/struct.UserId.html
+ /// [`UserId`]: ../model/id/struct.UserId.html
/// [`users`]: #structfield.users
///
/// # Examples
diff --git a/src/client/bridge/gateway/mod.rs b/src/client/bridge/gateway/mod.rs
index 27b5c10..a542dbc 100644
--- a/src/client/bridge/gateway/mod.rs
+++ b/src/client/bridge/gateway/mod.rs
@@ -1,4 +1,4 @@
-//! The client gateway bridge is support essential for the [`client`] module.
+//! The client gateway bridge is support essential for the [`client`][client] module.
//!
//! This is made available for user use if one wishes to be lower-level or avoid
//! the higher functionality of the [`Client`].
@@ -38,13 +38,14 @@
//! For almost every - if not every - use case, you only need to _possibly_ be
//! concerned about the [`ShardManager`] in this module.
//!
+//! [client]: ../../index.html
//! [`Client`]: ../../struct.Client.html
-//! [`client`]: ../..
//! [`Shard`]: ../../../gateway/struct.Shard.html
//! [`ShardManager`]: struct.ShardManager.html
//! [`ShardManager::restart`]: struct.ShardManager.html#method.restart
//! [`ShardManager::shutdown`]: struct.ShardManager.html#method.shutdown
-//! [`ShardQueuer`]: struct.ShardQueuer.html
+//! [`ShardManagerMessage`]: enum.ShardManagerMessage.html
+//! [`ShardQueue`]: struct.ShardQueuer.html
//! [`ShardRunner`]: struct.ShardRunner.html
pub mod event;
@@ -127,7 +128,7 @@ pub enum ShardManagerMessage {
/// This should usually be wrapped in a [`ShardClientMessage`].
///
/// [`ShardClientMessage`]: enum.ShardClientMessage.html
-/// [`ShardQueuer`]: enum.ShardQueuer.html
+/// [`ShardQueuer`]: struct.ShardQueuer.html
#[derive(Clone, Debug)]
pub enum ShardQueuerMessage {
/// Message to start a shard, where the 0-index element is the ID of the
diff --git a/src/client/bridge/gateway/shard_manager_monitor.rs b/src/client/bridge/gateway/shard_manager_monitor.rs
index e9a07cd..4989ef2 100644
--- a/src/client/bridge/gateway/shard_manager_monitor.rs
+++ b/src/client/bridge/gateway/shard_manager_monitor.rs
@@ -12,7 +12,7 @@ use super::{ShardManager, ShardManagerMessage};
/// receiving [`ShardManagerMessage`]s, such as whether to shutdown a shard or
/// shutdown everything entirely.
///
-/// [`ShardManagerMessage`]: struct.ShardManagerMessage.html
+/// [`ShardManagerMessage`]: enum.ShardManagerMessage.html
#[derive(Debug)]
pub struct ShardManagerMonitor {
/// An clone of the Arc to the manager itself.
diff --git a/src/client/bridge/gateway/shard_messenger.rs b/src/client/bridge/gateway/shard_messenger.rs
index a3b5918..11e75ce 100644
--- a/src/client/bridge/gateway/shard_messenger.rs
+++ b/src/client/bridge/gateway/shard_messenger.rs
@@ -106,10 +106,9 @@ impl ShardMessenger {
/// # }
/// ```
///
- /// [`Event::GuildMembersChunk`]:
- /// ../../model/event/enum.Event.html#variant.GuildMembersChunk
- /// [`Guild`]: ../../model/guild/struct.Guild.html
- /// [`Member`]: ../../model/guild/struct.Member.html
+ /// [`Event::GuildMembersChunk`]: ../../../model/event/enum.Event.html#variant.GuildMembersChunk
+ /// [`Guild`]: ../../../model/guild/struct.Guild.html
+ /// [`Member`]: ../../../model/guild/struct.Member.html
pub fn chunk_guilds<It>(
&self,
guild_ids: It,
@@ -261,9 +260,9 @@ impl ShardMessenger {
/// # }
/// ```
///
- /// [`DoNotDisturb`]: ../../model/user/enum.OnlineStatus.html#variant.DoNotDisturb
- /// [`Invisible`]: ../../model/user/enum.OnlineStatus.html#variant.Invisible
- /// [`Offline`]: ../../model/user/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 29024c9..f281d21 100644
--- a/src/client/bridge/gateway/shard_runner_message.rs
+++ b/src/client/bridge/gateway/shard_runner_message.rs
@@ -17,7 +17,7 @@ pub enum ShardRunnerMessage {
/// The maximum number of members to receive [`GuildMembersChunkEvent`]s
/// for.
///
- /// [`GuildMembersChunkEvent`]: ../../../model/event/GuildMembersChunkEvent.html
+ /// [`GuildMembersChunkEvent`]: ../../../model/event/struct.GuildMembersChunkEvent.html
limit: Option<u16>,
/// Text to filter members by.
///
diff --git a/src/client/bridge/mod.rs b/src/client/bridge/mod.rs
index 41fcdec..a3a431d 100644
--- a/src/client/bridge/mod.rs
+++ b/src/client/bridge/mod.rs
@@ -1,4 +1,4 @@
-//! A collection of bridged support between the [`client`] module and other
+//! A collection of bridged support between the [`client`](../index.html) module and other
//! modules.
//!
//! **Warning**: You likely _do not_ need to mess with anything in here. Beware.
diff --git a/src/client/mod.rs b/src/client/mod.rs
index d5f8711..6fcb84c 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -92,10 +92,10 @@ use self::bridge::voice::ClientVoiceManager;
/// client.start();
/// ```
///
-/// [`Shard`]: gateway/struct.Shard.html
+/// [`Shard`]: ../gateway/struct.Shard.html
/// [`EventHandler::message`]: trait.EventHandler.html#tymethod.message
/// [`Event::MessageCreate`]: ../model/event/enum.Event.html#variant.MessageCreate
-/// [sharding docs]: gateway/index.html#sharding
+/// [sharding docs]: ../index.html#sharding
pub struct Client {
/// A ShareMap which requires types to be Send + Sync. This is a map that
/// can be safely shared across contexts.
@@ -169,13 +169,12 @@ pub struct Client {
///
/// Refer to [example 05] for an example on using the `data` field.
///
- /// [`Context::data`]: struct.Context.html#method.data
+ /// [`Context::data`]: struct.Context.html#structfield.data
/// [`Event::MessageCreate`]: ../model/event/enum.Event.html#variant.MessageCreate
/// [`Event::MessageDelete`]: ../model/event/enum.Event.html#variant.MessageDelete
/// [`Event::MessageDeleteBulk`]: ../model/event/enum.Event.html#variant.MessageDeleteBulk
/// [`Event::MessageUpdate`]: ../model/event/enum.Event.html#variant.MessageUpdate
- /// [example 05]:
- /// https://github.com/serenity-rs/serenity/tree/master/examples/05_command_framework
+ /// [example 05]: https://github.com/serenity-rs/serenity/tree/master/examples/05_command_framework
pub data: Arc<Mutex<ShareMap>>,
/// A vector of all active shards that have received their [`Event::Ready`]
/// payload, and have dispatched to [`on_ready`] if an event handler was
@@ -387,7 +386,7 @@ impl Client {
}
/// Sets a framework to be used with the client. All message events will be
- /// passed through the framework _after_ being passed to the [`on_message`]
+ /// passed through the framework _after_ being passed to the [`message`]
/// event handler.
///
/// See the [framework module-level documentation][framework docs] for more
@@ -486,7 +485,7 @@ impl Client {
/// Refer to the documentation for the `framework` module for more in-depth
/// information.
///
- /// [`on_message`]: #method.on_message
+ /// [`message`]: trait.EventHandler.html#method.message
/// [framework docs]: ../framework/index.html
#[cfg(feature = "framework")]
pub fn with_framework<F: Framework + Send + 'static>(&mut self, f: F) {
@@ -534,7 +533,7 @@ impl Client {
/// # }
/// ```
///
- /// [gateway docs]: gateway/index.html#sharding
+ /// [gateway docs]: ../gateway/index.html#sharding
pub fn start(&mut self) -> Result<()> {
self.start_connection([0, 0, 1])
}
@@ -586,7 +585,7 @@ impl Client {
/// an error.
///
/// [`ClientError::Shutdown`]: enum.ClientError.html#variant.Shutdown
- /// [gateway docs]: gateway/index.html#sharding
+ /// [gateway docs]: ../gateway/index.html#sharding
pub fn start_autosharded(&mut self) -> Result<()> {
let (x, y) = {
let res = http::get_bot_gateway()?;
@@ -673,7 +672,7 @@ impl Client {
/// [`ClientError::Shutdown`]: enum.ClientError.html#variant.Shutdown
/// [`start`]: #method.start
/// [`start_autosharded`]: #method.start_autosharded
- /// [gateway docs]: gateway/index.html#sharding
+ /// [gateway docs]: ../gateway/index.html#sharding
pub fn start_shard(&mut self, shard: u64, shards: u64) -> Result<()> {
self.start_connection([shard, shard, shards])
}
@@ -727,7 +726,7 @@ impl Client {
/// [`ClientError::Shutdown`]: enum.ClientError.html#variant.Shutdown
/// [`start_shard`]: #method.start_shard
/// [`start_shard_range`]: #method.start_shard_range
- /// [Gateway docs]: gateway/index.html#sharding
+ /// [Gateway docs]: ../gateway/index.html#sharding
pub fn start_shards(&mut self, total_shards: u64) -> Result<()> {
self.start_connection([0, total_shards - 1, total_shards])
}
@@ -797,7 +796,7 @@ impl Client {
/// [`ClientError::Shutdown`]: enum.ClientError.html#variant.Shutdown
/// [`start_shard`]: #method.start_shard
/// [`start_shards`]: #method.start_shards
- /// [Gateway docs]: gateway/index.html#sharding
+ /// [Gateway docs]: ../gateway/index.html#sharding
pub fn start_shard_range(&mut self, range: [u64; 2], total_shards: u64) -> Result<()> {
self.start_connection([range[0], range[1], total_shards])
}
diff --git a/src/constants.rs b/src/constants.rs
index 89a2085..5485d7e 100644
--- a/src/constants.rs
+++ b/src/constants.rs
@@ -13,7 +13,7 @@ pub const LARGE_THRESHOLD: u8 = 250;
pub const MESSAGE_CODE_LIMIT: u16 = 2000;
/// The [UserAgent] sent along with every request.
///
-/// [UserAgent]: ../hyper/header/struct.UserAgent.html
+/// [UserAgent]: ../../hyper/header/struct.UserAgent.html
pub const USER_AGENT: &str = concat!(
"DiscordBot (https://github.com/serenity-rs/serenity, ",
env!("CARGO_PKG_VERSION"),
diff --git a/src/framework/standard/configuration.rs b/src/framework/standard/configuration.rs
index c237286..795493d 100644
--- a/src/framework/standard/configuration.rs
+++ b/src/framework/standard/configuration.rs
@@ -10,7 +10,7 @@ use std::{
};
use super::command::PrefixCheck;
-/// The configuration to use for a [`Framework`] associated with a [`Client`]
+/// The configuration to use for a [`StandardFramework`] associated with a [`Client`]
/// instance.
///
/// This allows setting configurations like the depth to search for commands,
@@ -40,7 +40,7 @@ use super::command::PrefixCheck;
/// ```
///
/// [`Client`]: ../../client/struct.Client.html
-/// [`Framework`]: struct.Framework.html
+/// [`StandardFramework`]: struct.StandardFramework.html
/// [default implementation]: #impl-Default
pub struct Configuration {
#[doc(hidden)] pub allow_dm: bool,
diff --git a/src/framework/standard/mod.rs b/src/framework/standard/mod.rs
index 52b955b..8731372 100644
--- a/src/framework/standard/mod.rs
+++ b/src/framework/standard/mod.rs
@@ -53,12 +53,12 @@ use client::CACHE;
#[cfg(feature = "cache")]
use model::channel::Channel;
-/// A convenience macro for generating a struct fulfilling the [`Command`] trait.
+/// A convenience macro for generating a struct fulfilling the [`Command`][command trait] trait.
///
-/// This is meant for use with the [`Framework`], specifically `Framework`::{[`cmd`]/[`command`]}.
+/// This is meant for use with the [`StandardFramework`], specifically `Framework`::{[`cmd`]/[`command`]}.
///
///
-/// If you're just looking for a simple "register this function as a command", use [`Framework::on`].
+/// If you're just looking for a simple "register this function as a command", use [`StandardFramework::on`].
///
/// # Examples
///
@@ -87,11 +87,11 @@ use model::channel::Channel;
/// });
/// ```
///
-/// [`Framework`]: framework/index.html
-/// [`cmd`]: struct.Framework.html#method.cmd
-/// [`command`]: struct.Framework.html#method.command
-/// [`Framework::on`]: struct.Framework.html#method.on
-/// [`Command`]: trait.Command.html
+/// [command trait]: framework/standard/trait.Command.html
+/// [`StandardFramework`]: framework/standard/struct.StandardFramework.html
+/// [`cmd`]: framework/standard/struct.StandardFramework.html#method.cmd
+/// [`command`]: framework/standard/struct.StandardFramework.html#method.command
+/// [`StandardFramework::on`]: framework/standard/struct.StandardFramework.html#method.on
#[macro_export]
macro_rules! command {
($fname:ident($c:ident) $b:block) => {
@@ -215,13 +215,12 @@ pub struct StandardFramework {
/// - a command check has been set.
///
/// This is used internally to determine whether or not - in addition to
- /// dispatching to the [`EventHandler::on_message`] handler - to have the
+ /// dispatching to the [`EventHandler::message`] handler - to have the
/// framework check if a [`Event::MessageCreate`] should be processed by
/// itself.
///
- /// [`EventHandler::on_message`]:
- /// ../client/event_handler/trait.EventHandler.html#method.on_message
- /// [`Event::MessageCreate`]: ../model/event/enum.Event.html#variant.MessageCreate
+ /// [`EventHandler::message`]: ../../client/trait.EventHandler.html#method.message
+ /// [`Event::MessageCreate`]: ../../model/event/enum.Event.html#variant.MessageCreate
pub initialized: bool,
user_id: u64,
}
@@ -255,7 +254,7 @@ impl StandardFramework {
/// .prefix("~")));
/// ```
///
- /// [`Client`]: ../client/struct.Client.html
+ /// [`Client`]: ../../client/struct.Client.html
/// [`Configuration::default`]: struct.Configuration.html#method.default
/// [`depth`]: struct.Configuration.html#method.depth
/// [`prefix`]: struct.Configuration.html#method.prefix
diff --git a/src/gateway/mod.rs b/src/gateway/mod.rs
index ffacba7..07d882c 100644
--- a/src/gateway/mod.rs
+++ b/src/gateway/mod.rs
@@ -3,9 +3,9 @@
//!
//! A shard is an interface for the lower-level receiver and sender. It provides
//! what can otherwise be thought of as "sugar methods". A shard represents a
-//! single connection to Discord. If acting as a [`Bot`] user, you can make
-//! use of a method named "sharding" to have multiple shards, potentially
-//! offloading some server load to another server(s).
+//! single connection to Discord. You can make use of a method named "sharding"
+//! to have multiple shards, potentially offloading some server load to another
+//! server(s).
//!
//! # Sharding
//!
@@ -38,15 +38,12 @@
//! instance. This should be used when you, for example, want to split 10 shards
//! across 3 instances.
//!
-//! **Note**: User accounts can not shard. Use [`Client::start`].
-//!
-//! [`Bot`]: ../enum.LoginType.html#variant.Bot
-//! [`Client`]: ../struct.Client.html
-//! [`Client::start`]: ../struct.Client.html#method.start
-//! [`Client::start_autosharded`]: ../struct.Client.html#method.start_autosharded
-//! [`Client::start_shard`]: ../struct.Client.html#method.start_shard
-//! [`Client::start_shard_range`]: ../struct.Client.html#method.start_shard_range
-//! [`Client::start_shards`]: ../struct.Client.html#method.start_shards
+//! [`Client`]: ../client/struct.Client.html
+//! [`Client::start`]: ../client/struct.Client.html#method.start
+//! [`Client::start_autosharded`]: ../client/struct.Client.html#method.start_autosharded
+//! [`Client::start_shard`]: ../client/struct.Client.html#method.start_shard
+//! [`Client::start_shard_range`]: ../client/struct.Client.html#method.start_shard_range
+//! [`Client::start_shards`]: ../client/struct.Client.html#method.start_shards
//! [docs]: https://discordapp.com/developers/docs/topics/gateway#sharding
mod error;
diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs
index 13944e6..09a3b69 100644
--- a/src/gateway/shard.rs
+++ b/src/gateway/shard.rs
@@ -56,7 +56,7 @@ use websocket::{
///
/// See the documentation for [`new`] on how to use this.
///
-/// [`Client`]: ../struct.Client.html
+/// [`Client`]: ../client/struct.Client.html
/// [`new`]: #method.new
/// [`receive`]: #method.receive
/// [docs]: https://discordapp.com/developers/docs/topics/gateway#sharding
@@ -640,8 +640,8 @@ impl Shard {
/// Note that, if the shard is already in a stage of
/// [`ConnectionStage::Connecting`], then no action will be performed.
///
- /// [`ConnectionStage::Connecting`]: ../../../gateway/enum.ConnectionStage.html#variant.Connecting
- /// [`session_id`]: ../../../gateway/struct.Shard.html#method.session_id
+ /// [`ConnectionStage::Connecting`]: ../gateway/enum.ConnectionStage.html#variant.Connecting
+ /// [`session_id`]: ../gateway/struct.Shard.html#method.session_id
pub fn should_reconnect(&mut self) -> Option<ReconnectType> {
if self.stage == ConnectionStage::Connecting {
return None;
@@ -733,10 +733,9 @@ impl Shard {
/// # }
/// ```
///
- /// [`Event::GuildMembersChunk`]:
- /// ../../model/event/enum.Event.html#variant.GuildMembersChunk
- /// [`Guild`]: ../../model/guild/struct.Guild.html
- /// [`Member`]: ../../model/guild/struct.Member.html
+ /// [`Event::GuildMembersChunk`]: ../model/event/enum.Event.html#variant.GuildMembersChunk
+ /// [`Guild`]: ../model/guild/struct.Guild.html
+ /// [`Member`]: ../model/guild/struct.Member.html
pub fn chunk_guilds<It>(
&mut self,
guild_ids: It,
diff --git a/src/http/mod.rs b/src/http/mod.rs
index d9454c2..d9a6a62 100644
--- a/src/http/mod.rs
+++ b/src/http/mod.rs
@@ -20,7 +20,7 @@
//! instance methods where possible, as they each offer different
//! levels of a high-level interface to the HTTP module.
//!
-//! [`Client`]: ../struct.Client.html
+//! [`Client`]: ../client/struct.Client.html
//! [model]: ../model/index.html
pub mod ratelimiting;
@@ -159,7 +159,7 @@ pub fn add_group_recipient(group_id: u64, user_id: u64) -> Result<()> {
/// [`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
+/// [Manage Roles]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES
pub fn add_member_role(guild_id: u64, user_id: u64, role_id: u64) -> Result<()> {
wind(204, Request {
body: None,
@@ -178,7 +178,7 @@ pub fn add_member_role(guild_id: u64, user_id: u64, role_id: u64) -> Result<()>
///
/// [`Guild`]: ../model/guild/struct.Guild.html
/// [`User`]: ../model/user/struct.User.html
-/// [Ban Members]: ../model/permissions/constant.BAN_MEMBERS.html
+/// [Ban Members]: ../model/permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS
pub fn ban_user(guild_id: u64, user_id: u64, delete_message_days: u8, reason: &str) -> Result<()> {
wind(204, Request {
body: None,
@@ -201,7 +201,7 @@ pub fn ban_user(guild_id: u64, user_id: u64, delete_message_days: u8, reason: &s
/// **Note**: Requires that you have the [Ban Members] permission.
///
/// [`Guild`]: ../model/guild/struct.Guild.html
-/// [Ban Members]: ../model/permissions/constant.BAN_MEMBERS.html
+/// [Ban Members]: ../model/permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS
pub fn ban_zeyla(guild_id: u64, delete_message_days: u8, reason: &str) -> Result<()> {
ban_user(guild_id, 114_941_315_417_899_012, delete_message_days, reason)
}
@@ -215,7 +215,7 @@ pub fn ban_zeyla(guild_id: u64, delete_message_days: u8, reason: &str) -> Result
/// **Note**: Requires that you have the [Ban Members] permission.
///
/// [`Guild`]: ../model/guild/struct.Guild.html
-/// [Ban Members]: ../model/permissions/constant.BAN_MEMBERS.html
+/// [Ban Members]: ../model/permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS
pub fn ban_luna(guild_id: u64, delete_message_days: u8, reason: &str) -> Result<()> {
ban_user(guild_id, 180_731_582_049_550_336, delete_message_days, reason)
}
@@ -229,7 +229,7 @@ pub fn ban_luna(guild_id: u64, delete_message_days: u8, reason: &str) -> Result<
/// **Note**: Requires that you have the [Ban Members] permission.
///
/// [`Guild`]: ../model/guild/struct.Guild.html
-/// [Ban Members]: ../model/permissions/constant.BAN_MEMBERS.html
+/// [Ban Members]: ../model/permissions/struct.Permissions.html#associatedconstant.BAN_MEMBERS
pub fn ban_servermoms(guild_id: u64, delete_message_days: u8, reason: &str) -> Result<()> {
ban_zeyla(guild_id, delete_message_days, reason)?;
ban_luna(guild_id, delete_message_days, reason)
@@ -261,7 +261,7 @@ pub fn broadcast_typing(channel_id: u64) -> Result<()> {
/// [`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
+/// [Manage Channels]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
pub fn create_channel(guild_id: u64, map: &Value) -> Result<GuildChannel> {
fire(Request {
body: Some(map.to_string().as_bytes()),
@@ -272,14 +272,14 @@ pub fn create_channel(guild_id: u64, map: &Value) -> Result<GuildChannel> {
/// Creates an emoji in the given [`Guild`] with the given data.
///
-/// View the source code for [`Context::create_emoji`] to see what fields this
-/// requires.
+/// View the source code for [`Guild`]'s [`create_emoji`] method to see what
+/// fields this requires.
///
/// **Note**: Requires the [Manage Emojis] permission.
///
-/// [`Context::create_emoji`]: ../struct.Context.html#method.create_emoji
+/// [`create_emoji`]: ../model/guild/struct.Guild.html#method.create_emoji
/// [`Guild`]: ../model/guild/struct.Guild.html
-/// [Manage Emojis]: ../model/permissions/constant.MANAGE_EMOJIS.html
+/// [Manage Emojis]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_EMOJIS
pub fn create_emoji(guild_id: u64, map: &Value) -> Result<Emoji> {
fire(Request {
body: Some(map.to_string().as_bytes()),
@@ -340,7 +340,7 @@ pub fn create_guild(map: &Value) -> Result<PartialGuild> {
///
/// [`Guild`]: ../model/guild/struct.Guild.html
/// [`Integration`]: ../model/guild/struct.Integration.html
-/// [Manage Guild]: ../model/permissions/constant.MANAGE_GUILD.html
+/// [Manage Guild]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD
/// [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<()> {
wind(204, Request {
@@ -359,8 +359,8 @@ pub fn create_guild_integration(guild_id: u64, integration_id: u64, map: &Value)
/// **Note**: Requires the [Create Invite] permission.
///
/// [`GuildChannel`]: ../model/channel/struct.GuildChannel.html
-/// [`RichInvite`]: ../model/guild/struct.RichInvite.html
-/// [Create Invite]: ../model/permissions/constant.CREATE_INVITE.html
+/// [`RichInvite`]: ../model/invite/struct.RichInvite.html
+/// [Create Invite]: ../model/permissions/struct.Permissions.html#associatedconstant.CREATE_INVITE
/// [docs]: https://discordapp.com/developers/docs/resources/channel#create-channel-invite
pub fn create_invite(channel_id: u64, map: &JsonMap) -> Result<RichInvite> {
let body = serde_json::to_vec(map)?;
@@ -1636,7 +1636,7 @@ pub fn remove_ban(guild_id: u64, user_id: u64) -> Result<()> {
/// [`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
+/// [Manage Roles]: ../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_ROLES
pub fn remove_member_role(guild_id: u64, user_id: u64, role_id: u64) -> Result<()> {
wind(204, Request {
body: None,
diff --git a/src/http/ratelimiting.rs b/src/http/ratelimiting.rs
index 309ba35..298ca6f 100644
--- a/src/http/ratelimiting.rs
+++ b/src/http/ratelimiting.rs
@@ -8,7 +8,7 @@
//! > For example, `/channels/:channel_id` and
//! > `/channels/:channel_id/messages/:message_id` both take `channel_id` into
//! > account when generating rate limits since it's the major parameter. The
-//! only current major parameters are `channel_id` and `guild_id`.
+//! only current major parameters are `channel_id`, `guild_id` and `webhook_id`.
//!
//! This results in the two URIs of `GET /channels/4/messages/7` and
//! `GET /channels/5/messages/8` being rate limited _separately_. However, the
@@ -98,7 +98,7 @@ lazy_static! {
/// ```
///
/// [`RateLimit`]: struct.RateLimit.html
- /// [`Route`]: enum.Route.html
+ /// [`Route`]: ../routing/enum.Route.html
pub static ref ROUTES: Arc<Mutex<HashMap<Route, Arc<Mutex<RateLimit>>>>> = {
Arc::new(Mutex::new(HashMap::default()))
};
@@ -204,7 +204,7 @@ pub(super) fn perform(req: Request) -> Result<Response> {
/// 429s.
///
/// [`ROUTES`]: struct.ROUTES.html
-/// [`Route`]: enum.Route.html
+/// [`Route`]: ../routing/enum.Route.html
/// [Discord docs]: https://discordapp.com/developers/docs/topics/rate-limits
#[derive(Clone, Debug, Default)]
pub struct RateLimit {
diff --git a/src/http/routing.rs b/src/http/routing.rs
index 81d25a3..52be61c 100644
--- a/src/http/routing.rs
+++ b/src/http/routing.rs
@@ -111,133 +111,133 @@ pub enum Route {
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsId(u64),
/// Route for the `/guilds/:guild_id/bans` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdBans(u64),
/// Route for the `/guilds/:guild_id/audit-logs` path.
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdAuditLogs(u64),
/// Route for the `/guilds/:guild_id/bans/:user_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdBansUserId(u64),
/// Route for the `/guilds/:guild_id/channels/:channel_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdChannels(u64),
/// Route for the `/guilds/:guild_id/embed` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdEmbed(u64),
/// Route for the `/guilds/:guild_id/emojis` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdEmojis(u64),
/// Route for the `/guilds/:guild_id/emojis/:emoji_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdEmojisId(u64),
/// Route for the `/guilds/:guild_id/integrations` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdIntegrations(u64),
/// Route for the `/guilds/:guild_id/integrations/:integration_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdIntegrationsId(u64),
/// Route for the `/guilds/:guild_id/integrations/:integration_id/sync`
/// path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdIntegrationsIdSync(u64),
/// Route for the `/guilds/:guild_id/invites` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdInvites(u64),
/// Route for the `/guilds/:guild_id/members` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdMembers(u64),
/// Route for the `/guilds/:guild_id/members/:user_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdMembersId(u64),
/// Route for the `/guilds/:guild_id/members/:user_id/roles/:role_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdMembersIdRolesId(u64),
/// Route for the `/guilds/:guild_id/members/@me/nick` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdMembersMeNick(u64),
/// Route for the `/guilds/:guild_id/prune` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdPrune(u64),
/// Route for the `/guilds/:guild_id/regions` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdRegions(u64),
/// Route for the `/guilds/:guild_id/roles` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdRoles(u64),
/// Route for the `/guilds/:guild_id/roles/:role_id` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdRolesId(u64),
/// Route for the `/guilds/:guild_id/vanity-url` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdVanityUrl(u64),
/// Route for the `/guilds/:guild_id/webhooks` path.
///
/// The data is the relevant [`GuildId`].
///
- /// [`GuildId`]: struct.GuildId.html
+ /// [`GuildId`]: ../../model/id/struct.GuildId.html
GuildsIdWebhooks(u64),
/// Route for the `/invites/:code` path.
InvitesCode,
diff --git a/src/lib.rs b/src/lib.rs
index 7c9533b..0971092 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -228,7 +228,7 @@ lazy_static! {
/// CACHE.write().settings_mut().max_messages(10);
/// ```
///
- /// [`CurrentUser`]: model/struct.CurrentUser.html
+ /// [`CurrentUser`]: model/user/struct.CurrentUser.html
/// [`Cache`]: cache/struct.Cache.html
/// [cache module documentation]: cache/index.html
pub static ref CACHE: RwLock<Cache> = RwLock::new(Cache::default());
diff --git a/src/model/application.rs b/src/model/application.rs
index 894e8df..004f40d 100644
--- a/src/model/application.rs
+++ b/src/model/application.rs
@@ -20,7 +20,7 @@ pub struct ApplicationInfo {
/// If a bot is public, anyone may invite it to their [`Guild`]. While a bot
/// is private, only the owner may add it to a guild.
///
- /// [`Guild`]: struct.Guild.html
+ /// [`Guild`]: ../guild/struct.Guild.html
#[serde(default = "default_true")]
pub bot_public: bool,
/// Indicator of whether the bot requires an OAuth2 code grant.
diff --git a/src/model/channel/attachment.rs b/src/model/channel/attachment.rs
index 0530b6f..23d69dd 100644
--- a/src/model/channel/attachment.rs
+++ b/src/model/channel/attachment.rs
@@ -103,8 +103,8 @@ impl Attachment {
/// Returns an [`Error::Hyper`] when there is a problem retrieving the
/// attachment.
///
- /// [`Error::Hyper`]: ../enum.Error.html#variant.Hyper
- /// [`Error::Io`]: ../enum.Error.html#variant.Io
+ /// [`Error::Hyper`]: ../../enum.Error.html#variant.Hyper
+ /// [`Error::Io`]: ../../enum.Error.html#variant.Io
/// [`Message`]: struct.Message.html
pub fn download(&self) -> Result<Vec<u8>> {
let hyper = request_client!();
diff --git a/src/model/channel/channel_category.rs b/src/model/channel/channel_category.rs
index 7a49c7e..47b2281 100644
--- a/src/model/channel/channel_category.rs
+++ b/src/model/channel/channel_category.rs
@@ -49,7 +49,7 @@ impl ChannelCategory {
///
/// **Note**: Requires the [Manage Channel] permission.
///
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channel]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[inline]
pub fn delete_permission(&self, permission_type: PermissionOverwriteType) -> Result<()> {
self.id.delete_permission(permission_type)
diff --git a/src/model/channel/channel_id.rs b/src/model/channel/channel_id.rs
index ceb05c3..6715562 100644
--- a/src/model/channel/channel_id.rs
+++ b/src/model/channel/channel_id.rs
@@ -40,7 +40,7 @@ impl ChannelId {
/// let _successful = ChannelId(7).broadcast_typing();
/// ```
///
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[inline]
pub fn broadcast_typing(&self) -> Result<()> { http::broadcast_typing(self.0) }
@@ -52,11 +52,11 @@ impl ChannelId {
///
/// Requires the [Manage Channels] permission.
///
- /// [`GuildChannel::create_permission`]: struct.GuildChannel.html#method.create_permission
- /// [`Member`]: struct.Member.html
- /// [`PermissionOverwrite`]: struct.PermissionOverwrite.html
- /// [`Role`]: struct.Role.html
- /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html
+ /// [`GuildChannel::create_permission`]: ../channel/struct.GuildChannel.html#method.create_permission
+ /// [`Member`]: ../guild/struct.Member.html
+ /// [`PermissionOverwrite`]: ../channel/struct.PermissionOverwrite.html
+ /// [`Role`]: ../guild/struct.Role.html
+ /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
pub fn create_permission(&self, target: &PermissionOverwrite) -> Result<()> {
let (id, kind) = match target.kind {
PermissionOverwriteType::Member(id) => (id.0, "member"),
@@ -81,10 +81,10 @@ impl ChannelId {
/// Requires the [Add Reactions] permission, _if_ the current user is the
/// first user to perform a react with a certain emoji.
///
- /// [`Emoji`]: struct.Emoji.html
- /// [`Message`]: struct.Message.html
- /// [`Message::react`]: struct.Message.html#method.react
- /// [Add Reactions]: permissions/constant.ADD_REACTIONS.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
+ /// [`Message`]: ../channel/struct.Message.html
+ /// [`Message::react`]: ../channel/struct.Message.html#method.react
+ /// [Add Reactions]: ../permissions/struct.Permissions.html#associatedconstant.ADD_REACTIONS
#[inline]
pub fn create_reaction<M, R>(&self, message_id: M, reaction_type: R) -> Result<()>
where M: Into<MessageId>, R: Into<ReactionType> {
@@ -110,9 +110,9 @@ impl ChannelId {
/// Requires the [Manage Messages] permission, if the current user is not
/// the author of the message.
///
- /// [`Message`]: struct.Message.html
- /// [`Message::delete`]: struct.Message.html#method.delete
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`Message`]: ../channel/struct.Message.html
+ /// [`Message::delete`]: ../channel/struct.Message.html#method.delete
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_message<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self._delete_message(message_id.into())
@@ -137,9 +137,9 @@ impl ChannelId {
/// Returns [`ModelError::BulkDeleteAmount`] if an attempt was made to
/// delete either 0 or more than 100 messages.
///
- /// [`Channel::delete_messages`]: enum.Channel.html#method.delete_messages
- /// [`ModelError::BulkDeleteAmount`]: ../enum.ModelError.html#variant.BulkDeleteAmount
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`Channel::delete_messages`]: ../channel/enum.Channel.html#method.delete_messages
+ /// [`ModelError::BulkDeleteAmount`]: ../error/enum.Error.html#variant.BulkDeleteAmount
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
pub fn delete_messages<T: AsRef<MessageId>, It: IntoIterator<Item=T>>(&self, message_ids: It) -> Result<()> {
let ids = message_ids
.into_iter()
@@ -167,7 +167,7 @@ impl ChannelId {
///
/// **Note**: Requires the [Manage Channel] permission.
///
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channel]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
pub fn delete_permission(&self, permission_type: PermissionOverwriteType) -> Result<()> {
http::delete_permission(
self.0,
@@ -183,8 +183,8 @@ impl ChannelId {
/// **Note**: Requires the [Manage Messages] permission, _if_ the current
/// user did not perform the reaction.
///
- /// [`Reaction`]: struct.Reaction.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`Reaction`]: ../channel/struct.Reaction.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_reaction<M, R>(&self,
message_id: M,
@@ -230,8 +230,8 @@ impl ChannelId {
/// channel_id.edit(|c| c.name("test").bitrate(64000));
/// ```
///
- /// [`Channel`]: enum.Channel.html
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
+ /// [`Channel`]: ../channel/enum.Channel.html
+ /// [Manage Channel]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[cfg(feature = "utils")]
#[inline]
pub fn edit<F: FnOnce(EditChannel) -> EditChannel>(&self, f: F) -> Result<GuildChannel> {
@@ -255,10 +255,10 @@ impl ChannelId {
/// is over the [`the limit`], containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`EditMessage`]: ../builder/struct.EditMessage.html
- /// [`Message`]: struct.Message.html
- /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`EditMessage`]: ../../builder/struct.EditMessage.html
+ /// [`Message`]: ../channel/struct.Message.html
+ /// [`the limit`]: ../../builder/struct.EditMessage.html#method.content
#[cfg(feature = "utils")]
#[inline]
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message>
@@ -303,7 +303,7 @@ impl ChannelId {
/// Gets all of the channel's invites.
///
/// Requires the [Manage Channels] permission.
- /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[inline]
pub fn invites(&self) -> Result<Vec<RichInvite>> { http::get_channel_invites(self.0) }
@@ -311,7 +311,7 @@ impl ChannelId {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
self._message(message_id.into())
@@ -331,8 +331,8 @@ impl ChannelId {
///
/// Requires the [Read Message History] permission.
///
- /// [`Channel::messages`]: enum.Channel.html#method.messages
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`Channel::messages`]: ../channel/enum.Channel.html#method.messages
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
pub fn messages<F>(&self, f: F) -> Result<Vec<Message>>
where F: FnOnce(GetMessages) -> GetMessages {
let mut map = f(GetMessages::default()).0;
@@ -387,7 +387,7 @@ impl ChannelId {
/// Pins a [`Message`] to the channel.
///
- /// [`Message`]: struct.Message.html
+ /// [`Message`]: ../channel/struct.Message.html
#[inline]
pub fn pin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self._pin(message_id.into())
@@ -399,7 +399,7 @@ impl ChannelId {
/// Gets the list of [`Message`]s which are pinned to the channel.
///
- /// [`Message`]: struct.Message.html
+ /// [`Message`]: ../channel/struct.Message.html
#[inline]
pub fn pins(&self) -> Result<Vec<Message>> { http::get_pins(self.0) }
@@ -410,11 +410,11 @@ impl ChannelId {
///
/// **Note**: Requires the [Read Message History] permission.
///
- /// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users
- /// [`Emoji`]: struct.Emoji.html
- /// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`Channel::reaction_users`]: ../channel/enum.Channel.html#method.reaction_users
+ /// [`Emoji`]: ../guild/struct.Emoji.html
+ /// [`Message`]: ../channel/struct.Message.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
pub fn reaction_users<M, R, U>(&self,
message_id: M,
reaction_type: R,
@@ -458,7 +458,7 @@ impl ChannelId {
/// over the limit.
///
/// [`ChannelId`]: struct.ChannelId.html
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
#[inline]
pub fn say<D: ::std::fmt::Display>(&self, content: D) -> Result<Message> {
self.send_message(|m| m.content(content))
@@ -514,12 +514,12 @@ impl ChannelId {
/// [`HttpError::InvalidRequest(PayloadTooLarge)`][`HttpError::InvalidRequest`]
/// if the file is too large to send.
///
- /// [`ClientError::MessageTooLong`]: ../client/enum.ClientError.html#variant.MessageTooLong
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
- /// [`CreateMessage::content`]: ../utils/builder/struct.CreateMessage.html#method.content
+ /// [`ClientError::MessageTooLong`]: ../../client/enum.ClientError.html#variant.MessageTooLong
+ /// [`HttpError::InvalidRequest`]: ../../http/enum.HttpError.html#variant.InvalidRequest
+ /// [`CreateMessage::content`]: ../../builder/struct.CreateMessage.html#method.content
/// [`GuildChannel`]: struct.GuildChannel.html
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [Attach Files]: ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[cfg(feature = "utils")]
pub fn send_files<'a, F, T, It: IntoIterator<Item=T>>(&self, files: It, f: F) -> Result<Message>
where F: FnOnce(CreateMessage) -> CreateMessage, T: Into<AttachmentType<'a>> {
@@ -556,7 +556,7 @@ impl ChannelId {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`Channel`]: enum.Channel.html
+ /// [`Channel`]: ../channel/enum.Channel.html
/// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
/// [`CreateMessage`]: ../../builder/struct.CreateMessage.html
/// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
@@ -584,8 +584,8 @@ impl ChannelId {
///
/// Requires the [Manage Messages] permission.
///
- /// [`Message`]: struct.Message.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`Message`]: ../channel/struct.Message.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self._unpin(message_id.into())
@@ -599,7 +599,7 @@ impl ChannelId {
///
/// **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_channel_webhooks(self.0) }
}
diff --git a/src/model/channel/embed.rs b/src/model/channel/embed.rs
index 0e6fe8e..6dcccb9 100644
--- a/src/model/channel/embed.rs
+++ b/src/model/channel/embed.rs
@@ -75,7 +75,7 @@ impl Embed {
///
/// This should only be useful in conjunction with [`Webhook::execute`].
///
- /// [`Webhook::execute`]: struct.Webhook.html
+ /// [`Webhook::execute`]: ../webhook/struct.Webhook.html
///
/// # Examples
///
diff --git a/src/model/channel/group.rs b/src/model/channel/group.rs
index 4baa654..ad16fa0 100644
--- a/src/model/channel/group.rs
+++ b/src/model/channel/group.rs
@@ -19,8 +19,8 @@ use std::fmt::Write as FmtWrite;
/// A group channel - potentially including other [`User`]s - separate from a
/// [`Guild`].
///
-/// [`Guild`]: struct.Guild.html
-/// [`User`]: struct.User.html
+/// [`Guild`]: ../guild/struct.Guild.html
+/// [`User`]: ../user/struct.User.html
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Group {
/// The Id of the group channel.
@@ -52,7 +52,7 @@ impl Group {
/// **Note**: Groups have a limit of 10 recipients, including the current
/// user.
///
- /// [`http::add_group_recipient`]: ../http/fn.add_group_recipient.html
+ /// [`http::add_group_recipient`]: ../../http/fn.add_group_recipient.html
#[inline]
pub fn add_recipient<U: Into<UserId>>(&self, user: U) -> Result<()> {
self._add_recipient(user.into())
@@ -79,10 +79,10 @@ impl Group {
/// Requires the [Add Reactions] permission, _if_ the current user is the
/// first user to perform a react with a certain emoji.
///
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
/// [`Message::react`]: struct.Message.html#method.react
- /// [Add Reactions]: permissions/constant.ADD_REACTIONS.html
+ /// [Add Reactions]: ../permissions/struct.Permissions.html#associatedconstant.ADD_REACTIONS
#[inline]
pub fn create_reaction<M, R>(&self, message_id: M, reaction_type: R) -> Result<()>
where M: Into<MessageId>, R: Into<ReactionType> {
@@ -104,8 +104,8 @@ impl Group {
/// delete either 0 or more than 100 messages.
///
/// [`Channel::delete_messages`]: enum.Channel.html#method.delete_messages
- /// [`ModelError::BulkDeleteAmount`]: ../enum.ModelError.html#variant.BulkDeleteAmount
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`ModelError::BulkDeleteAmount`]: ../error/enum.Error.html#variant.BulkDeleteAmount
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_messages<T: AsRef<MessageId>, It: IntoIterator<Item=T>>(&self, message_ids: It) -> Result<()> {
self.channel_id.delete_messages(message_ids)
@@ -116,7 +116,7 @@ impl Group {
///
/// **Note**: Requires the [Manage Channel] permission.
///
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channel]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[inline]
pub fn delete_permission(&self, permission_type: PermissionOverwriteType) -> Result<()> {
self.channel_id.delete_permission(permission_type)
@@ -128,7 +128,7 @@ impl Group {
/// user did not perform the reaction.
///
/// [`Reaction`]: struct.Reaction.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_reaction<M, R>(&self,
message_id: M,
@@ -155,10 +155,10 @@ impl Group {
/// is over the [`the limit`], containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`EditMessage`]: ../builder/struct.EditMessage.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`EditMessage`]: ../../builder/struct.EditMessage.html
/// [`Message`]: struct.Message.html
- /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
+ /// [`the limit`]: ../../builder/struct.EditMessage.html#method.content
#[inline]
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message>
where F: FnOnce(EditMessage) -> EditMessage, M: Into<MessageId> {
@@ -191,7 +191,7 @@ impl Group {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
self.channel_id.message(message_id)
@@ -201,7 +201,7 @@ impl Group {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn messages<F>(&self, f: F) -> Result<Vec<Message>>
where F: FnOnce(GetMessages) -> GetMessages {
@@ -243,10 +243,10 @@ impl Group {
/// **Note**: Requires the [Read Message History] permission.
///
/// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn reaction_users<M, R, U>(
&self,
@@ -286,8 +286,8 @@ impl Group {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`ChannelId`]: ../model/id/struct.ChannelId.html
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
+ /// [`ChannelId`]: ../id/struct.ChannelId.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
#[inline]
pub fn say(&self, content: &str) -> Result<Message> { self.channel_id.say(content) }
@@ -305,10 +305,10 @@ impl Group {
/// [`ClientError::MessageTooLong`] will be returned, containing the number
/// of unicode code points over the limit.
///
- /// [`ChannelId::send_files`]: struct.ChannelId.html#method.send_files
- /// [`ClientError::MessageTooLong`]: ../client/enum.ClientError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ChannelId::send_files`]: ../id/struct.ChannelId.html#method.send_files
+ /// [`ClientError::MessageTooLong`]: ../../client/enum.ClientError.html#variant.MessageTooLong
+ /// [Attach Files]: ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[inline]
pub fn send_files<'a, F, T, It: IntoIterator<Item=T>>(&self, files: It, f: F) -> Result<Message>
where F: FnOnce(CreateMessage) -> CreateMessage, T: Into<AttachmentType<'a>> {
@@ -322,8 +322,8 @@ impl Group {
///
/// **Note**: Requires the [Send Messages] permission.
///
- /// [`CreateMessage`]: ../builder/struct.CreateMessage.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`CreateMessage`]: ../../builder/struct.CreateMessage.html
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[inline]
pub fn send_message<F: FnOnce(CreateMessage) -> CreateMessage>(&self, f: F) -> Result<Message> {
self.channel_id.send_message(f)
@@ -334,7 +334,7 @@ impl Group {
/// Requires the [Manage Messages] permission.
///
/// [`Message`]: struct.Message.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self.channel_id.unpin(message_id)
diff --git a/src/model/channel/guild_channel.rs b/src/model/channel/guild_channel.rs
index 2f54fa1..b1fec05 100644
--- a/src/model/channel/guild_channel.rs
+++ b/src/model/channel/guild_channel.rs
@@ -63,8 +63,8 @@ pub struct GuildChannel {
pub name: String,
/// Permission overwrites for [`Member`]s and for [`Role`]s.
///
- /// [`Member`]: struct.Member.html
- /// [`Role`]: struct.Role.html
+ /// [`Member`]: ../guild/struct.Member.html
+ /// [`Role`]: ../guild/struct.Role.html
pub permission_overwrites: Vec<PermissionOverwrite>,
/// The position of the channel.
///
@@ -102,8 +102,8 @@ impl GuildChannel {
/// Returns a [`ModelError::InvalidPermissions`] if the current user does
/// not have the required permissions.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
pub fn broadcast_typing(&self) -> Result<()> { self.id.broadcast_typing() }
/// Creates an invite leading to the given channel.
@@ -225,16 +225,17 @@ impl GuildChannel {
/// ```
///
/// [`Channel`]: enum.Channel.html
- /// [`Member`]: struct.Member.html
+ /// [`Member`]: ../guild/struct.Member.html
/// [`PermissionOverwrite`]: struct.PermissionOverwrite.html
/// [`PermissionOverwrite::Member`]: struct.PermissionOverwrite.html#variant.Member
/// [`PermissionOverwrite::Role`]: struct.PermissionOverwrite.html#variant.Role
- /// [`Role`]: struct.Role.html
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html
- /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
- /// [Send TTS Messages]: permissions/constant.SEND_TTS_MESSAGES.html
+ /// [`Role`]: ../guild/struct.Role.html
+ /// [Attach Files]:
+ /// ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
+ /// [Manage Webhooks]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
+ /// [Send TTS Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_TTS_MESSAGES
#[inline]
pub fn create_permission(&self, target: &PermissionOverwrite) -> Result<()> {
self.id.create_permission(target)
@@ -269,8 +270,8 @@ impl GuildChannel {
/// delete either 0 or more than 100 messages.
///
/// [`Channel::delete_messages`]: enum.Channel.html#method.delete_messages
- /// [`ModelError::BulkDeleteAmount`]: ../enum.ModelError.html#variant.BulkDeleteAmount
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`ModelError::BulkDeleteAmount`]: ../error/enum.Error.html#variant.BulkDeleteAmount
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_messages<T: AsRef<MessageId>, It: IntoIterator<Item=T>>(&self, message_ids: It) -> Result<()> {
self.id.delete_messages(message_ids)
@@ -281,7 +282,7 @@ impl GuildChannel {
///
/// **Note**: Requires the [Manage Channel] permission.
///
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channel]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[inline]
pub fn delete_permission(&self, permission_type: PermissionOverwriteType) -> Result<()> {
self.id.delete_permission(permission_type)
@@ -293,7 +294,7 @@ impl GuildChannel {
/// user did not perform the reaction.
///
/// [`Reaction`]: struct.Reaction.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_reaction<M, R>(&self,
message_id: M,
@@ -359,10 +360,10 @@ impl GuildChannel {
/// is over the [`the limit`], containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`EditMessage`]: ../builder/struct.EditMessage.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`EditMessage`]: ../../builder/struct.EditMessage.html
/// [`Message`]: struct.Message.html
- /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
+ /// [`the limit`]: ../../builder/struct.EditMessage.html#method.content
#[inline]
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message>
where F: FnOnce(EditMessage) -> EditMessage, M: Into<MessageId> {
@@ -379,7 +380,7 @@ impl GuildChannel {
/// Gets all of the channel's invites.
///
/// Requires the [Manage Channels] permission.
- /// [Manage Channels]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channels]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[inline]
pub fn invites(&self) -> Result<Vec<RichInvite>> { self.id.invites() }
@@ -403,7 +404,7 @@ impl GuildChannel {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
self.id.message(message_id)
@@ -416,7 +417,7 @@ impl GuildChannel {
/// Requires the [Read Message History] permission.
///
/// [`Channel::messages`]: enum.Channel.html#method.messages
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn messages<F>(&self, f: F) -> Result<Vec<Message>>
where F: FnOnce(GetMessages) -> GetMessages {
@@ -511,14 +512,14 @@ impl GuildChannel {
/// Returns a [`ModelError::GuildNotFound`] if the channel's guild could
/// not be found in the [`Cache`].
///
- /// [`Cache`]: ../cache/struct.Cache.html
- /// [`ModelError::GuildNotFound`]: enum.ModelError.html#variant.GuildNotFound
- /// [`Guild`]: struct.Guild.html
- /// [`Member`]: struct.Member.html
+ /// [`Cache`]: ../../cache/struct.Cache.html
+ /// [`ModelError::GuildNotFound`]: ../error/enum.Error.html#variant.GuildNotFound
+ /// [`Guild`]: ../guild/struct.Guild.html
+ /// [`Member`]: ../guild/struct.Member.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Attach Files]: ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[cfg(feature = "cache")]
#[inline]
pub fn permissions_for<U: Into<UserId>>(&self, user_id: U) -> Result<Permissions> {
@@ -532,6 +533,8 @@ impl GuildChannel {
}
/// Pins a [`Message`] to the channel.
+ ///
+ /// [`Message`]: struct.Message.html
#[inline]
pub fn pin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> { self.id.pin(message_id) }
@@ -547,10 +550,10 @@ impl GuildChannel {
/// **Note**: Requires the [Read Message History] permission.
///
/// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
pub fn reaction_users<M, R, U>(
&self,
message_id: M,
@@ -571,8 +574,8 @@ impl GuildChannel {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`ChannelId`]: struct.ChannelId.html
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
+ /// [`ChannelId`]: ../id/struct.ChannelId.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
#[inline]
pub fn say(&self, content: &str) -> Result<Message> { self.id.say(content) }
@@ -590,10 +593,10 @@ impl GuildChannel {
/// [`ClientError::MessageTooLong`] will be returned, containing the number
/// of unicode code points over the limit.
///
- /// [`ChannelId::send_files`]: struct.ChannelId.html#method.send_files
- /// [`ClientError::MessageTooLong`]: ../client/enum.ClientError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ChannelId::send_files`]: ../id/struct.ChannelId.html#method.send_files
+ /// [`ClientError::MessageTooLong`]: ../../client/enum.ClientError.html#variant.MessageTooLong
+ /// [Attach Files]: ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[inline]
pub fn send_files<'a, F, T, It: IntoIterator<Item=T>>(&self, files: It, f: F) -> Result<Message>
where F: FnOnce(CreateMessage) -> CreateMessage, T: Into<AttachmentType<'a>> {
@@ -615,10 +618,10 @@ impl GuildChannel {
/// Returns a [`ModelError::InvalidPermissions`] if the current user does
/// not have the required permissions.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
/// [`Message`]: struct.Message.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
pub fn send_message<F: FnOnce(CreateMessage) -> CreateMessage>(&self, f: F) -> Result<Message> {
#[cfg(feature = "cache")]
{
@@ -637,7 +640,7 @@ impl GuildChannel {
/// Requires the [Manage Messages] permission.
///
/// [`Message`]: struct.Message.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self.id.unpin(message_id)
@@ -647,7 +650,7 @@ impl GuildChannel {
///
/// **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/channel/message.rs b/src/model/channel/message.rs
index 5d61c4a..8b580ff 100644
--- a/src/model/channel/message.rs
+++ b/src/model/channel/message.rs
@@ -52,7 +52,7 @@ pub struct Message {
pub mention_everyone: bool,
/// Array of [`Role`]s' Ids mentioned in the message.
///
- /// [`Role`]: struct.Role.html
+ /// [`Role`]: ../guild/struct.Role.html
pub mention_roles: Vec<RoleId>,
/// Array of users mentioned in the message.
pub mentions: Vec<User>,
@@ -138,9 +138,9 @@ impl Message {
/// [`ModelError::InvalidPermissions`] if the current user does not have
/// the required permissions.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [`ModelError::InvalidUser`]: enum.ModelError.html#variant.InvalidUser
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [`ModelError::InvalidUser`]: ../error/enum.Error.html#variant.InvalidUser
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
pub fn delete(&self) -> Result<()> {
#[cfg(feature = "cache")]
{
@@ -166,9 +166,9 @@ impl Message {
/// [`ModelError::InvalidPermissions`] if the current user does not have
/// the required permissions.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
/// [`Reaction`]: struct.Reaction.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
pub fn delete_reactions(&self) -> Result<()> {
#[cfg(feature = "cache")]
{
@@ -210,10 +210,10 @@ impl Message {
/// is over [`the limit`], containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::InvalidUser`]: enum.ModelError.html#variant.InvalidUser
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`EditMessage`]: ../builder/struct.EditMessage.html
- /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
+ /// [`ModelError::InvalidUser`]: ../error/enum.Error.html#variant.InvalidUser
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`EditMessage`]: ../../builder/struct.EditMessage.html
+ /// [`the limit`]: ../../builder/struct.EditMessage.html#method.content
pub fn edit<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(EditMessage) -> EditMessage {
#[cfg(feature = "cache")]
@@ -312,10 +312,10 @@ impl Message {
///
/// **Note**: Requires the [Read Message History] permission.
///
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn reaction_users<R, U>(
&self,
@@ -402,8 +402,8 @@ impl Message {
/// [`ModelError::InvalidPermissions`] if the current user does not have
/// the required permissions.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES.html
pub fn pin(&self) -> Result<()> {
#[cfg(feature = "cache")]
{
@@ -427,10 +427,11 @@ impl Message {
/// [`ModelError::InvalidPermissions`] if the current user does not have the
/// required [permissions].
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [`Emoji`]: struct.Emoji.html
- /// [Add Reactions]: permissions/constant.ADD_REACTIONS.html
- /// [permissions]: permissions
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [`Emoji`]: ../guild/struct.Emoji.html
+ /// [Add Reactions]:
+ /// ../permissions/struct.Permissions.html#associatedconstant.ADD_REACTIONS
+ /// [permissions]: ../permissions/index.html
#[inline]
pub fn react<R: Into<ReactionType>>(&self, reaction_type: R) -> Result<()> {
self._react(&reaction_type.into())
@@ -468,9 +469,9 @@ impl Message {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
pub fn reply(&self, content: &str) -> Result<Message> {
if let Some(length_over) = Message::overflow_length(content) {
return Err(Error::Model(ModelError::MessageTooLong(length_over)));
@@ -499,7 +500,7 @@ impl Message {
/// Checks whether the message mentions passed [`UserId`].
///
- /// [`UserId`]: ../../model/id/struct.UserId.html
+ /// [`UserId`]: ../id/struct.UserId.html
#[inline]
pub fn mentions_user_id<I: Into<UserId>>(&self, id: I) -> bool {
self._mentions_user_id(id.into())
@@ -526,8 +527,8 @@ impl Message {
/// [`ModelError::InvalidPermissions`] if the current user does not have
/// the required permissions.
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
pub fn unpin(&self) -> Result<()> {
#[cfg(feature = "cache")]
{
diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs
index 5ba9a87..05a117d 100644
--- a/src/model/channel/mod.rs
+++ b/src/model/channel/mod.rs
@@ -41,14 +41,14 @@ pub enum Channel {
Group(Arc<RwLock<Group>>),
/// A [text] or [voice] channel within a [`Guild`].
///
- /// [`Guild`]: struct.Guild.html
+ /// [`Guild`]: ../guild/struct.Guild.html
/// [text]: enum.ChannelType.html#variant.Text
/// [voice]: enum.ChannelType.html#variant.Voice
Guild(Arc<RwLock<GuildChannel>>),
/// A private channel to another [`User`]. No other users may access the
/// channel. For multi-user "private channels", use a group.
///
- /// [`User`]: struct.User.html
+ /// [`User`]: ../user/struct.User.html
Private(Arc<RwLock<PrivateChannel>>),
/// A category of [`GuildChannel`]s
///
@@ -224,10 +224,10 @@ impl Channel {
/// Requires the [Add Reactions] permission, _if_ the current user is the
/// first user to perform a react with a certain emoji.
///
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
/// [`Message::react`]: struct.Message.html#method.react
- /// [Add Reactions]: permissions/constant.ADD_REACTIONS.html
+ /// [Add Reactions]: ../permissions/struct.Permissions.html#associatedconstant.ADD_REACTIONS
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -271,7 +271,7 @@ impl Channel {
///
/// [`Message`]: struct.Message.html
/// [`Message::delete`]: struct.Message.html#method.delete
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -285,7 +285,7 @@ impl Channel {
/// user did not perform the reaction.
///
/// [`Reaction`]: struct.Reaction.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -314,10 +314,10 @@ impl Channel {
/// is over the [`the limit`], containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`EditMessage`]: ../builder/struct.EditMessage.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`EditMessage`]: ../../builder/struct.EditMessage.html
/// [`Message`]: struct.Message.html
- /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
+ /// [`the limit`]: ../../builder/struct.EditMessage.html#method.content
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -345,7 +345,7 @@ impl Channel {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -368,7 +368,7 @@ impl Channel {
/// let _messages = channel.messages(|g| g.after(id).limit(100));
/// ```
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -389,10 +389,10 @@ impl Channel {
///
/// **Note**: Requires the [Read Message History] permission.
///
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -430,8 +430,8 @@ impl Channel {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`ChannelId`]: struct.ChannelId.html
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
+ /// [`ChannelId`]: ../id/struct.ChannelId.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -451,10 +451,10 @@ impl Channel {
/// [`ClientError::MessageTooLong`] will be returned, containing the number
/// of unicode code points over the limit.
///
- /// [`ChannelId::send_files`]: struct.ChannelId.html#method.send_files
- /// [`ClientError::MessageTooLong`]: ../client/enum.ClientError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ChannelId::send_files`]: ../id/struct.ChannelId.html#method.send_files
+ /// [`ClientError::MessageTooLong`]: ../../client/enum.ClientError.html#variant.MessageTooLong
+ /// [Attach Files]: ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -479,9 +479,9 @@ impl Channel {
/// over the limit.
///
/// [`Channel`]: enum.Channel.html
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`CreateMessage`]: ../builder/struct.CreateMessage.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`CreateMessage`]: ../../builder/struct.CreateMessage.html
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
@@ -495,7 +495,7 @@ impl Channel {
/// Requires the [Manage Messages] permission.
///
/// [`Message`]: struct.Message.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[cfg(feature = "model")]
#[deprecated(since = "0.4.2", note = "Use the inner channel's method")]
#[inline]
diff --git a/src/model/channel/private_channel.rs b/src/model/channel/private_channel.rs
index 91a019c..2657d3b 100644
--- a/src/model/channel/private_channel.rs
+++ b/src/model/channel/private_channel.rs
@@ -58,10 +58,10 @@ impl PrivateChannel {
/// Requires the [Add Reactions] permission, _if_ the current user is the
/// first user to perform a react with a certain emoji.
///
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
/// [`Message::react`]: struct.Message.html#method.react
- /// [Add Reactions]: permissions/constant.ADD_REACTIONS.html
+ /// [Add Reactions]: ../permissions/struct.Permissions.html#associatedconstant.ADD_REACTIONS
pub fn create_reaction<M, R>(&self, message_id: M, reaction_type: R) -> Result<()>
where M: Into<MessageId>, R: Into<ReactionType> {
self.id.create_reaction(message_id, reaction_type)
@@ -88,8 +88,8 @@ impl PrivateChannel {
/// delete either 0 or more than 100 messages.
///
/// [`Channel::delete_messages`]: enum.Channel.html#method.delete_messages
- /// [`ModelError::BulkDeleteAmount`]: ../enum.ModelError.html#variant.BulkDeleteAmount
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [`ModelError::BulkDeleteAmount`]: ../error/enum.Error.html#variant.BulkDeleteAmount
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_messages<T: AsRef<MessageId>, It: IntoIterator<Item=T>>(&self, message_ids: It) -> Result<()> {
self.id.delete_messages(message_ids)
@@ -100,7 +100,7 @@ impl PrivateChannel {
///
/// **Note**: Requires the [Manage Channel] permission.
///
- /// [Manage Channel]: permissions/constant.MANAGE_CHANNELS.html
+ /// [Manage Channel]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_CHANNELS
#[inline]
pub fn delete_permission(&self, permission_type: PermissionOverwriteType) -> Result<()> {
self.id.delete_permission(permission_type)
@@ -112,7 +112,7 @@ impl PrivateChannel {
/// user did not perform the reaction.
///
/// [`Reaction`]: struct.Reaction.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn delete_reaction<M, R>(&self,
message_id: M,
@@ -138,10 +138,10 @@ impl PrivateChannel {
/// is over the [`the limit`], containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`EditMessage`]: ../builder/struct.EditMessage.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`EditMessage`]: ../../builder/struct.EditMessage.html
/// [`Message`]: struct.Message.html
- /// [`the limit`]: ../builder/struct.EditMessage.html#method.content
+ /// [`the limit`]: ../../builder/struct.EditMessage.html#method.content
#[inline]
pub fn edit_message<F, M>(&self, message_id: M, f: F) -> Result<Message>
where F: FnOnce(EditMessage) -> EditMessage, M: Into<MessageId> {
@@ -163,7 +163,7 @@ impl PrivateChannel {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn message<M: Into<MessageId>>(&self, message_id: M) -> Result<Message> {
self.id.message(message_id)
@@ -176,7 +176,7 @@ impl PrivateChannel {
/// Requires the [Read Message History] permission.
///
/// [`Channel::messages`]: enum.Channel.html#method.messages
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn messages<F>(&self, f: F) -> Result<Vec<Message>>
where F: FnOnce(GetMessages) -> GetMessages {
@@ -194,10 +194,10 @@ impl PrivateChannel {
/// **Note**: Requires the [Read Message History] permission.
///
/// [`Channel::reaction_users`]: enum.Channel.html#method.reaction_users
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn reaction_users<M, R, U>(&self,
message_id: M,
@@ -229,8 +229,8 @@ impl PrivateChannel {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`ChannelId`]: ../model/id/struct.ChannelId.html
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
+ /// [`ChannelId`]: ../id/struct.ChannelId.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
#[inline]
pub fn say<D: ::std::fmt::Display>(&self, content: D) -> Result<Message> { self.id.say(content) }
@@ -248,10 +248,10 @@ impl PrivateChannel {
/// [`ClientError::MessageTooLong`] will be returned, containing the number
/// of unicode code points over the limit.
///
- /// [`ChannelId::send_files`]: struct.ChannelId.html#method.send_files
- /// [`ClientError::MessageTooLong`]: ../client/enum.ClientError.html#variant.MessageTooLong
- /// [Attach Files]: permissions/constant.ATTACH_FILES.html
- /// [Send Messages]: permissions/constant.SEND_MESSAGES.html
+ /// [`ChannelId::send_files`]: ../id/struct.ChannelId.html#method.send_files
+ /// [`ClientError::MessageTooLong`]: ../../client/enum.ClientError.html#variant.MessageTooLong
+ /// [Attach Files]: ../permissions/struct.Permissions.html#associatedconstant.ATTACH_FILES
+ /// [Send Messages]: ../permissions/struct.Permissions.html#associatedconstant.SEND_MESSAGES
#[inline]
pub fn send_files<'a, F, T, It: IntoIterator<Item=T>>(&self, files: It, f: F) -> Result<Message>
where F: FnOnce(CreateMessage) -> CreateMessage, T: Into<AttachmentType<'a>> {
@@ -269,8 +269,8 @@ impl PrivateChannel {
/// is over the above limit, containing the number of unicode code points
/// over the limit.
///
- /// [`ModelError::MessageTooLong`]: enum.ModelError.html#variant.MessageTooLong
- /// [`CreateMessage`]: ../builder/struct.CreateMessage.html
+ /// [`ModelError::MessageTooLong`]: ../error/enum.Error.html#variant.MessageTooLong
+ /// [`CreateMessage`]: ../../builder/struct.CreateMessage.html
/// [`Message`]: struct.Message.html
#[inline]
pub fn send_message<F: FnOnce(CreateMessage) -> CreateMessage>(&self, f: F) -> Result<Message> {
@@ -282,7 +282,7 @@ impl PrivateChannel {
/// Requires the [Manage Messages] permission.
///
/// [`Message`]: struct.Message.html
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
#[inline]
pub fn unpin<M: Into<MessageId>>(&self, message_id: M) -> Result<()> {
self.id.unpin(message_id)
diff --git a/src/model/channel/reaction.rs b/src/model/channel/reaction.rs
index 0f65e8b..94b3c32 100644
--- a/src/model/channel/reaction.rs
+++ b/src/model/channel/reaction.rs
@@ -34,7 +34,7 @@ pub struct Reaction {
pub message_id: MessageId,
/// The Id of the [`User`] that sent the reaction.
///
- /// [`User`]: struct.User.html
+ /// [`User`]: ../user/struct.User.html
pub user_id: UserId,
}
@@ -48,7 +48,7 @@ impl Reaction {
///
/// Requires the [Read Message History] permission.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
#[inline]
pub fn channel(&self) -> Result<Channel> {
self.channel_id.get()
@@ -66,9 +66,9 @@ impl Reaction {
/// [`ModelError::InvalidPermissions`] if the current user does not have
/// the required [permissions].
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [Manage Messages]: permissions/constant.MANAGE_MESSAGES.html
- /// [permissions]: permissions
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [Manage Messages]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_MESSAGES
+ /// [permissions]: ../permissions/index.html
pub fn delete(&self) -> Result<()> {
let user_id = feature_cache! {
{
@@ -109,7 +109,7 @@ impl Reaction {
/// your own message cache or otherwise having the message available if
/// possible.
///
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
/// [`Message`]: struct.Message.html
#[inline]
pub fn message(&self) -> Result<Message> {
@@ -145,12 +145,12 @@ impl Reaction {
/// Returns a [`ModelError::InvalidPermissions`] if the current user does
/// not have the required [permissions].
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [`Emoji`]: struct.Emoji.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [`Emoji`]: ../guild/struct.Emoji.html
/// [`Message`]: struct.Message.html
- /// [`User`]: struct.User.html
- /// [Read Message History]: permissions/constant.READ_MESSAGE_HISTORY.html
- /// [permissions]: permissions
+ /// [`User`]: ../user/struct.User.html
+ /// [Read Message History]: ../permissions/struct.Permissions.html#associatedconstant.READ_MESSAGE_HISTORY
+ /// [permissions]: ../permissions/index.html
#[inline]
pub fn users<R, U>(&self,
reaction_type: R,
@@ -185,14 +185,14 @@ pub enum ReactionType {
/// A reaction with a [`Guild`]s custom [`Emoji`], which is unique to the
/// guild.
///
- /// [`Emoji`]: struct.Emoji.html
- /// [`Guild`]: struct.Guild.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
+ /// [`Guild`]: ../guild/struct.Guild.html
Custom {
/// Whether the emoji is animated.
animated: bool,
/// The Id of the custom [`Emoji`].
///
- /// [`Emoji`]: struct.Emoji.html
+ /// [`Emoji`]: ../guild/struct.Emoji.html
id: EmojiId,
/// The name of the custom emoji. This is primarily used for decoration
/// and distinguishing the emoji client-side.
@@ -431,7 +431,7 @@ impl Display for ReactionType {
/// displayed. Otherwise, if the type is a
/// [unicode][`ReactionType::Unicode`], then the inner unicode is displayed.
///
- /// [`Emoji::fmt`]: struct.Emoji.html#method.fmt
+ /// [`Emoji::fmt`]: ../guild/struct.Emoji.html#method.fmt
/// [`ReactionType::Custom`]: enum.ReactionType.html#variant.Custom
/// [`ReactionType::Unicode`]: enum.ReactionType.html#variant.Unicode
fn fmt(&self, f: &mut Formatter) -> FmtResult {
diff --git a/src/model/error.rs b/src/model/error.rs
index 09aaded..05070a7 100644
--- a/src/model/error.rs
+++ b/src/model/error.rs
@@ -70,10 +70,10 @@ use super::Permissions;
/// # fn main() { }
/// ```
///
-/// [`Error`]: ../enum.Error.html
-/// [`Error::Model`]: ../enum.Error.html#variant.Model
-/// [`GuildId::ban`]: struct.GuildId.html#method.ban
-/// [`model`]: ./index.html
+/// [`Error`]: ../../enum.Error.html
+/// [`Error::Model`]: ../../enum.Error.html#variant.Model
+/// [`GuildId::ban`]: ../id/struct.GuildId.html#method.ban
+/// [`model`]: ../index.html
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub enum Error {
/// When attempting to delete below or above the minimum and maximum allowed
@@ -88,9 +88,9 @@ pub enum Error {
/// An indication that a [guild][`Guild`] could not be found by
/// [Id][`GuildId`] in the [`Cache`].
///
- /// [`Guild`]: ../model/guild/struct.Guild.html
- /// [`GuildId`]: ../model/id/struct.GuildId.html
- /// [`Cache`]: ../cache/struct.Cache.html
+ /// [`Guild`]: ../guild/struct.Guild.html
+ /// [`GuildId`]: ../id/struct.GuildId.html
+ /// [`Cache`]: ../../cache/struct.Cache.html
GuildNotFound,
/// Indicates that there are hierarchy problems restricting an action.
///
@@ -106,23 +106,23 @@ pub enum Error {
/// The provided [`Permission`]s is the set of required permissions
/// required.
///
- /// [`Permission`]: ../model/permissions/struct.Permissions.html
+ /// [`Permission`]: ../permissions/struct.Permissions.html
InvalidPermissions(Permissions),
/// An indicator that the [current user] can not perform an action.
///
- /// [current user]: ../model/user/struct.CurrentUser.html
+ /// [current user]: ../user/struct.CurrentUser.html
InvalidUser,
/// An indicator that an item is missing from the [`Cache`], and the action
/// can not be continued.
///
- /// [`Cache`]: ../cache/struct.Cache.html
+ /// [`Cache`]: ../../cache/struct.Cache.html
ItemMissing,
/// Indicates that a [`Message`]s content was too long and will not
/// successfully send, as the length is over 2000 codepoints, or 4000 bytes.
///
/// The number of bytes larger than the limit is provided.
///
- /// [`Message`]: ../model/channel/struct.Message.html
+ /// [`Message`]: ../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/event.rs b/src/model/event.rs
index 00705bb..191c98f 100644
--- a/src/model/event.rs
+++ b/src/model/event.rs
@@ -34,7 +34,7 @@ use std::mem;
/// [`Channel`]: ../channel/enum.Channel.html
/// [`Group`]: ../channel/struct.Group.html
/// [`Guild`]: ../guild/struct.Guild.html
-/// [`PrivateChannel`]: ../struct.PrivateChannel.html
+/// [`PrivateChannel`]: ../channel/struct.PrivateChannel.html
#[derive(Clone, Debug)]
pub struct ChannelCreateEvent {
/// The channel that was created.
@@ -1342,16 +1342,14 @@ pub enum Event {
/// Fires the [`Client::channel_delete`] event.
///
/// [`Channel`]: ../channel/enum.Channel.html
- /// [`Client::channel_delete`]:
- /// ../../client/struct.Client.html#channel_delete
+ /// [`Client::channel_delete`]: ../../client/struct.Client.html#channel_delete
ChannelDelete(ChannelDeleteEvent),
/// The pins for a [`Channel`] have been updated.
///
/// Fires the [`Client::channel_pins_update`] event.
///
/// [`Channel`]: ../channel/enum.Channel.html
- /// [`Client::channel_pins_update`]:
- /// ../../client/struct.Client.html#channel_pins_update
+ /// [`Client::channel_pins_update`]: ../../client/struct.Client.html#channel_pins_update
ChannelPinsUpdate(ChannelPinsUpdateEvent),
/// A [`User`] has been added to a [`Group`].
///
@@ -1414,8 +1412,7 @@ pub enum Event {
///
/// Fires the [`reaction_remove`] event handler.
///
- /// [`reaction_remove`]:
- /// ../../prelude/trait.EventHandler.html#method.reaction_remove
+ /// [`reaction_remove`]: ../../prelude/trait.EventHandler.html#method.reaction_remove
ReactionRemove(ReactionRemoveEvent),
/// A request was issued to remove all [`Reaction`]s from a [`Message`].
///
diff --git a/src/model/gateway.rs b/src/model/gateway.rs
index 989cff8..28e3d68 100644
--- a/src/model/gateway.rs
+++ b/src/model/gateway.rs
@@ -261,12 +261,12 @@ pub struct Gateway {
/// Information detailing the current online status of a [`User`].
///
-/// [`User`]: struct.User.html
+/// [`User`]: ../user/struct.User.html
#[derive(Clone, Debug)]
pub struct Presence {
/// The game that a [`User`] is current playing.
///
- /// [`User`]: struct.User.html
+ /// [`User`]: ../user/struct.User.html
pub game: Option<Game>,
/// The date of the last presence update.
pub last_modified: Option<u64>,
@@ -274,7 +274,7 @@ pub struct Presence {
pub nick: Option<String>,
/// The user's online status.
pub status: OnlineStatus,
- /// The Id of the [`User`]. Can be used to calculate the user's creation
+ /// The Id of the [`User`](../user/struct.User.html). Can be used to calculate the user's creation
/// date.
pub user_id: UserId,
/// The associated user instance.
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() {
diff --git a/src/model/id.rs b/src/model/id.rs
index 046de11..5ec5c75 100644
--- a/src/model/id.rs
+++ b/src/model/id.rs
@@ -106,7 +106,7 @@ pub struct RoleId(pub u64);
#[allow(derive_hash_xor_eq)]
pub struct UserId(pub u64);
-/// An identifier for a [`Webhook`](struct.Webhook.html).
+/// An identifier for a [`Webhook`](../webhook/struct.Webhook.html).
#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)]
#[allow(derive_hash_xor_eq)]
pub struct WebhookId(pub u64);
diff --git a/src/model/invite.rs b/src/model/invite.rs
index 2bbd5d9..a6aa756 100644
--- a/src/model/invite.rs
+++ b/src/model/invite.rs
@@ -19,8 +19,8 @@ use {http, utils};
pub struct Invite {
/// The approximate number of [`Member`]s in the related [`Guild`].
///
- /// [`Guild`]: struct.Guild.html
- /// [`Member`]: struct.Member.html
+ /// [`Guild`]: ../guild/struct.Guild.html
+ /// [`Member`]: ../guild/struct.Member.html
pub approximate_member_count: Option<u64>,
/// The approximate number of [`Member`]s with an active session in the
/// related [`Guild`].
@@ -28,14 +28,16 @@ pub struct Invite {
/// An active session is defined as an open, heartbeating WebSocket connection.
/// These include [invisible][`OnlineStatus::Invisible`] members.
///
- /// [`OnlineStatus::Invisible`]: enum.OnlineStatus.html#variant.Invisible
+ /// [`OnlineStatus::Invisible`]: ../user/enum.OnlineStatus.html#variant.Invisible
+ /// [`Guild`]: ../guild/struct.Guild.html
+ /// [`Member`]: ../guild/struct.Member.html
pub approximate_presence_count: Option<u64>,
/// The unique code for the invite.
pub code: String,
/// A representation of the minimal amount of information needed about the
/// [`GuildChannel`] being invited to.
///
- /// [`GuildChannel`]: struct.GuildChannel.html
+ /// [`GuildChannel`]: ../channel/struct.GuildChannel.html
pub channel: InviteChannel,
/// A representation of the minimal amount of information needed about the
/// [`Guild`] being invited to.
@@ -63,11 +65,11 @@ impl Invite {
/// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`]
/// if the current user does not have the required [permission].
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [`CreateInvite`]: ../builder/struct.CreateInvite.html
- /// [`GuildChannel`]: struct.GuildChannel.html
- /// [Create Invite]: permissions/constant.CREATE_INVITE.html
- /// [permission]: permissions/index.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [`CreateInvite`]: ../../builder/struct.CreateInvite.html
+ /// [`GuildChannel`]: ../channel/struct.GuildChannel.html
+ /// [Create Invite]: ../permissions/struct.Permissions.html#associatedconstant.CREATE_INVITE
+ /// [permission]: ../permissions/index.html
pub fn create<C, F>(channel_id: C, f: F) -> Result<RichInvite>
where C: Into<ChannelId>, F: FnOnce(CreateInvite) -> CreateInvite {
Self::_create(channel_id.into(), f)
@@ -98,9 +100,9 @@ impl Invite {
/// If the `cache` is enabled, returns a [`ModelError::InvalidPermissions`]
/// if the current user does not have the required [permission].
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
- /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html
- /// [permission]: permissions/index.html
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
+ /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD
+ /// [permission]: ../permissions/index.html
pub fn delete(&self) -> Result<Invite> {
#[cfg(feature = "cache")]
{
@@ -190,7 +192,7 @@ impl InviteGuild {
/// 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() }
@@ -226,7 +228,7 @@ impl InviteGuild {
/// the [`Invite`] struct.
///
/// [`Invite`]: struct.Invite.html
-/// [Manage Guild]: permissions/constant.MANAGE_GUILD.html
+/// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct RichInvite {
/// A representation of the minimal amount of information needed about the
@@ -281,11 +283,11 @@ impl RichInvite {
/// [`ModelError::InvalidPermissions`] if the current user does not have
/// the required [permission].
///
- /// [`ModelError::InvalidPermissions`]: enum.ModelError.html#variant.InvalidPermissions
+ /// [`ModelError::InvalidPermissions`]: ../error/enum.Error.html#variant.InvalidPermissions
/// [`Invite::delete`]: struct.Invite.html#method.delete
- /// [`http::delete_invite`]: ../http/fn.delete_invite.html
- /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html
- /// [permission]: permissions/index.html
+ /// [`http::delete_invite`]: ../../http/fn.delete_invite.html
+ /// [Manage Guild]: ../permissions/struct.Permissions.html#associatedconstant.MANAGE_GUILD.html
+ /// [permission]: ../permissions/index.html
pub fn delete(&self) -> Result<Invite> {
#[cfg(feature = "cache")]
{
diff --git a/src/model/permissions.rs b/src/model/permissions.rs
index 8e45620..784071e 100644
--- a/src/model/permissions.rs
+++ b/src/model/permissions.rs
@@ -164,35 +164,35 @@ __impl_bitflags! {
Permissions: u64 {
/// Allows for the creation of [`RichInvite`]s.
///
- /// [`RichInvite`]: ../struct.RichInvite.html
+ /// [`RichInvite`]: ../invite/struct.RichInvite.html
CREATE_INVITE = 0b0000_0000_0000_0000_0000_0000_0000_0001;
/// Allows for the kicking of guild [member]s.
///
- /// [member]: ../struct.Member.html
+ /// [member]: ../guild/struct.Member.html
KICK_MEMBERS = 0b0000_0000_0000_0000_0000_0000_0000_0010;
/// Allows the banning of guild [member]s.
///
- /// [member]: ../struct.Member.html
+ /// [member]: ../guild/struct.Member.html
BAN_MEMBERS = 0b0000_0000_0000_0000_0000_0000_0000_0100;
/// Allows all permissions, bypassing channel [permission overwrite]s.
///
- /// [permission overwrite]: ../struct.PermissionOverwrite.html
+ /// [permission overwrite]: ../channel/struct.PermissionOverwrite.html
ADMINISTRATOR = 0b0000_0000_0000_0000_0000_0000_0000_1000;
/// Allows management and editing of guild [channel]s.
///
- /// [channel]: ../struct.GuildChannel.html
+ /// [channel]: ../channel/struct.GuildChannel.html
MANAGE_CHANNELS = 0b0000_0000_0000_0000_0000_0000_0001_0000;
/// Allows management and editing of the [guild].
///
- /// [guild]: ../struct.Guild.html
+ /// [guild]: ../guild/struct.Guild.html
MANAGE_GUILD = 0b0000_0000_0000_0000_0000_0000_0010_0000;
/// [`Member`]s with this permission can add new [`Reaction`]s to a
/// [`Message`]. Members can still react using reactions already added
/// to messages without this permission.
///
- /// [`Member`]: ../struct.Member.html
- /// [`Message`]: ../struct.Message.html
- /// [`Reaction`]: ../struct.Reaction.html
+ /// [`Member`]: ../guild/struct.Member.html
+ /// [`Message`]: ../channel/struct.Message.html
+ /// [`Reaction`]: ../channel/struct.Reaction.html
ADD_REACTIONS = 0b0000_0000_0000_0000_0000_0000_0100_0000;
/// Allows viewing a guild's audit logs.
VIEW_AUDIT_LOG = 0b0000_0000_0000_0000_0000_0000_1000_0000;
@@ -243,8 +243,8 @@ __impl_bitflags! {
///
/// If this is disabled, then [`Member`]s must use push-to-talk.
///
- /// [`Member`]: ../struct.Member.html
- /// [voice]: ../enum.ChannelType.html#variant.Voice
+ /// [`Member`]: ../guild/struct.Member.html
+ /// [voice]: ../channel/enum.ChannelType.html#variant.Voice
USE_VAD = 0b0000_0010_0000_0000_0000_0000_0000_0000;
/// Allows members to change their own nickname in the guild.
CHANGE_NICKNAME = 0b0000_0100_0000_0000_0000_0000_0000_0000;
@@ -257,7 +257,7 @@ __impl_bitflags! {
/// Allows management of emojis created without the use of an
/// [`Integration`].
///
- /// [`Integration`]: ../struct.Integration.html
+ /// [`Integration`]: ../guild/struct.Integration.html
MANAGE_EMOJIS = 0b0100_0000_0000_0000_0000_0000_0000_0000;
}
}
diff --git a/src/model/user.rs b/src/model/user.rs
index d76b135..019bec9 100644
--- a/src/model/user.rs
+++ b/src/model/user.rs
@@ -75,7 +75,7 @@ impl CurrentUser {
///
/// This mutates the current user in-place.
///
- /// Refer to `EditProfile`'s documentation for its methods.
+ /// Refer to [`EditProfile`]'s documentation for its methods.
///
/// # Examples
///
@@ -88,6 +88,8 @@ impl CurrentUser {
///
/// CACHE.write().user.edit(|p| p.avatar(Some(&avatar)));
/// ```
+ ///
+ /// [`EditProfile`]: ../../builder/struct.EditProfile.html
pub fn edit<F>(&mut self, f: F) -> Result<()>
where F: FnOnce(EditProfile) -> EditProfile {
let mut map = VecMap::new();
@@ -204,13 +206,13 @@ impl CurrentUser {
/// # Errors
///
/// Returns an
- /// [`HttpError::InvalidRequest(Unauthorized)`][`HttpError::InvalidRequest`]
+ /// [`HttpError::UnsuccessfulRequest(Unauthorized)`][`HttpError::UnsuccessfulRequest`]
/// If the user is not authorized for this end point.
///
/// May return [`Error::Format`] while writing url to the buffer.
///
- /// [`Error::Format`]: ../enum.Error.html#variant.Format
- /// [`HttpError::InvalidRequest`]: ../http/enum.HttpError.html#variant.InvalidRequest
+ /// [`Error::Format`]: ../../enum.Error.html#variant.Format
+ /// [`HttpError::UnsuccessfulRequest`]: ../../http/enum.HttpError.html#variant.UnsuccessfulRequest
pub fn invite_url(&self, permissions: Permissions) -> Result<String> {
let bits = permissions.bits();
let client_id = http::get_current_application_info().map(|v| v.id)?;
@@ -458,7 +460,7 @@ impl User {
/// Returns a [`ModelError::MessagingBot`] if the user being direct messaged
/// is a bot user.
///
- /// [`ModelError::MessagingBot`]: enum.ModelError.html#variant.MessagingBot
+ /// [`ModelError::MessagingBot`]: ../error/enum.Error.html#variant.MessagingBot
/// [`PrivateChannel`]: struct.PrivateChannel.html
/// [`User::dm`]: struct.User.html#method.dm
// A tale with Clippy:
@@ -535,7 +537,7 @@ impl User {
/// Returns a [`ModelError::MessagingBot`] if the user being direct messaged
/// is a bot user.
///
- /// [`ModelError::MessagingBot`]: enum.ModelError.html#variant.MessagingBot
+ /// [`ModelError::MessagingBot`]: ../error/enum.Error.html#variant.MessagingBot
/// [direct_message]: #method.direct_message
#[cfg(feature = "builder")]
#[inline]
@@ -572,11 +574,11 @@ impl User {
/// let _ = message.author.has_role(guild_id, role_id);
/// ```
///
- /// [`Guild`]: struct.Guild.html
- /// [`GuildId`]: struct.GuildId.html
- /// [`PartialGuild`]: struct.PartialGuild.html
- /// [`Role`]: struct.Role.html
- /// [`Cache`]: ../cache/struct.Cache.html
+ /// [`Guild`]: ../guild/struct.Guild.html
+ /// [`GuildId`]: ../id/struct.GuildId.html
+ /// [`PartialGuild`]: ../guild/struct.PartialGuild.html
+ /// [`Role`]: ../guild/struct.Role.html
+ /// [`Cache`]: ../../cache/struct.Cache.html
// no-cache would warn on guild_id.
pub fn has_role<G, R>(&self, guild: G, role: R) -> bool
where G: Into<GuildContainer>, R: Into<RoleId> {
@@ -725,7 +727,7 @@ impl UserId {
/// Creates a direct message channel between the [current user] and the
/// user. This can also retrieve the channel if one already exists.
///
- /// [current user]: struct.CurrentUser.html
+ /// [current user]: ../user/struct.CurrentUser.html
pub fn create_dm_channel(&self) -> Result<PrivateChannel> {
let map = json!({
"recipient_id": self.0,
diff --git a/src/model/webhook.rs b/src/model/webhook.rs
index 68d6012..fca70fe 100644
--- a/src/model/webhook.rs
+++ b/src/model/webhook.rs
@@ -33,7 +33,7 @@ pub struct Webhook {
///
/// This can be modified via [`ExecuteWebhook::avatar`].
///
- /// [`ExecuteWebhook::avatar`]: ../builder/struct.ExecuteWebhook.html#method.avatar
+ /// [`ExecuteWebhook::avatar`]: ../../builder/struct.ExecuteWebhook.html#method.avatar
pub avatar: Option<String>,
/// The Id of the channel that owns the webhook.
pub channel_id: ChannelId,
@@ -43,7 +43,7 @@ pub struct Webhook {
///
/// This can be modified via [`ExecuteWebhook::username`].
///
- /// [`ExecuteWebhook::username`]: ../builder/struct.ExecuteWebhook.html#method.username
+ /// [`ExecuteWebhook::username`]: ../../builder/struct.ExecuteWebhook.html#method.username
pub name: Option<String>,
/// The webhook's secure token.
pub token: String,
@@ -60,7 +60,7 @@ impl Webhook {
/// As this calls the [`http::delete_webhook_with_token`] function,
/// authentication is not required.
///
- /// [`http::delete_webhook_with_token`]: ../http/fn.delete_webhook_with_token.html
+ /// [`http::delete_webhook_with_token`]: ../../http/fn.delete_webhook_with_token.html
#[inline]
pub fn delete(&self) -> Result<()> { http::delete_webhook_with_token(self.id.0, &self.token) }
@@ -108,8 +108,8 @@ impl Webhook {
/// let _ = webhook.edit(None, Some(&image)).expect("Error editing");
/// ```
///
- /// [`http::edit_webhook`]: ../http/fn.edit_webhook.html
- /// [`http::edit_webhook_with_token`]: ../http/fn.edit_webhook_with_token.html
+ /// [`http::edit_webhook`]: ../../http/fn.edit_webhook.html
+ /// [`http::edit_webhook_with_token`]: ../../http/fn.edit_webhook_with_token.html
pub fn edit(&mut self, name: Option<&str>, avatar: Option<&str>) -> Result<()> {
if name.is_none() && avatar.is_none() {
return Ok(());
@@ -205,7 +205,7 @@ impl Webhook {
/// As this calls the [`http::get_webhook_with_token`] function,
/// authentication is not required.
///
- /// [`http::get_webhook_with_token`]: ../http/fn.get_webhook_with_token.html
+ /// [`http::get_webhook_with_token`]: ../../http/fn.get_webhook_with_token.html
pub fn refresh(&mut self) -> Result<()> {
match http::get_webhook_with_token(self.id.0, &self.token) {
Ok(replacement) => {
@@ -224,7 +224,7 @@ impl WebhookId {
///
/// **Note**: Requires the [Manage Webhooks] permission.
///
- /// [Manage Webhooks]: permissions/constant.MANAGE_WEBHOOKS.html
+ /// [Manage Webhooks]: ../../model/permissions/struct.Permissions.html#associatedconstant.MANAGE_WEBHOOKS
#[inline]
pub fn get(self) -> Result<Webhook> { http::get_webhook(self.0) }
}
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 6c84384..347e19a 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -131,7 +131,7 @@ pub fn is_nsfw(name: &str) -> bool {
/// assert_eq!(utils::parse_invite(url), "0cDvIgU2voY8RSYL");
/// ```
///
-/// [`RichInvite`]: ../model/guild/struct.RichInvite.html
+/// [`RichInvite`]: ../model/invite/struct.RichInvite.html
pub fn parse_invite(code: &str) -> &str {
if code.starts_with("https://discord.gg/") {
&code[19..]