Skip to content

Commit

Permalink
Fix all the dead links in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Erk- authored and zeyla committed Aug 9, 2018
1 parent 826220f commit 40053a7
Show file tree
Hide file tree
Showing 46 changed files with 551 additions and 558 deletions.
4 changes: 2 additions & 2 deletions src/builder/create_invite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>);

Expand Down
2 changes: 1 addition & 1 deletion src/builder/edit_guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>);

Expand Down
10 changes: 5 additions & 5 deletions src/builder/edit_member.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand All @@ -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));

Expand All @@ -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()));

Expand All @@ -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()
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion src/builder/edit_profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 4 additions & 6 deletions src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -154,7 +154,6 @@ pub struct Cache {
/// - [`GuildMemberAdd`][`GuildMemberAddEvent`]
/// - [`GuildMemberRemove`][`GuildMemberRemoveEvent`]
/// - [`GuildMembersChunk`][`GuildMembersChunkEvent`]
/// - [`GuildSync`][`GuildSyncEvent`]
/// - [`PresenceUpdate`][`PresenceUpdateEvent`]
/// - [`Ready`][`ReadyEvent`]
///
Expand All @@ -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>>>,
Expand Down Expand Up @@ -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
///
Expand Down Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/client/bridge/gateway/mod.rs
Original file line number Diff line number Diff line change
@@ -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`].
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/client/bridge/gateway/shard_manager_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
13 changes: 6 additions & 7 deletions src/client/bridge/gateway/shard_messenger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/client/bridge/gateway/shard_runner_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 1 addition & 1 deletion src/client/bridge/mod.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
23 changes: 11 additions & 12 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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])
}
Expand Down Expand Up @@ -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()?;
Expand Down Expand Up @@ -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])
}
Expand Down Expand Up @@ -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])
}
Expand Down Expand Up @@ -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])
}
Expand Down
2 changes: 1 addition & 1 deletion src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
4 changes: 2 additions & 2 deletions src/framework/standard/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
25 changes: 12 additions & 13 deletions src/framework/standard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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
Expand Down
Loading

0 comments on commit 40053a7

Please sign in to comment.