diff options
| author | Austin Hellyer <[email protected]> | 2016-11-18 11:00:45 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-18 11:00:45 -0800 |
| commit | cf128b1a10d0636c8b4b5233d46b068cfe665688 (patch) | |
| tree | f36b1cd08d00cec69a76eb10c493ab3b86d61678 /src/model | |
| parent | Feature macros should use else as block separator (diff) | |
| download | serenity-cf128b1a10d0636c8b4b5233d46b068cfe665688.tar.xz serenity-cf128b1a10d0636c8b4b5233d46b068cfe665688.zip | |
A bit of docs
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel.rs | 4 | ||||
| -rw-r--r-- | src/model/invite.rs | 46 |
2 files changed, 29 insertions, 21 deletions
diff --git a/src/model/channel.rs b/src/model/channel.rs index 0534ff3..e994d4b 100644 --- a/src/model/channel.rs +++ b/src/model/channel.rs @@ -284,6 +284,8 @@ impl Group { /// Adds the given user to the group. If the user is already in the group, /// then nothing is done. /// + /// Refer to [`http::add_group_recipient`] for more information. + /// /// **Note**: Groups have a limit of 10 recipients, including the current /// user. #[cfg(feature = "methods")] @@ -1066,7 +1068,7 @@ impl ReactionType { pub fn as_data(&self) -> String { match *self { ReactionType::Custom { id, ref name } => { - format!("{}:{}", id, name) + format!("{}:{}", name, id) }, ReactionType::Unicode(ref unicode) => unicode.clone(), } diff --git a/src/model/invite.rs b/src/model/invite.rs index 55467e0..58773d1 100644 --- a/src/model/invite.rs +++ b/src/model/invite.rs @@ -8,26 +8,25 @@ use ::client::STATE; impl Invite { /// Accepts the invite, placing the current user in the [`Guild`] that the - /// invite was for. This will fire the [`Client::on_guild_create`] handler - /// once the associated event is received. + /// invite was for. /// - /// **Note**: This will fail if you are already in the `Guild`, or are - /// banned. A ban is equivilant to an IP ban. + /// Refer to [`http::accept_invite`] for more information. /// - /// **Note**: Requires that the current user be a user account. Bots can not - /// accept invites. Instead they must be accepted via OAuth2 authorization - /// links. These are in the format of: + /// **Note**: This will fail if you are already in the guild, or are banned. + /// A ban is equivilant to an IP ban. /// - /// `https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot` + /// **Note**: Requires that the current user be a user account. /// /// # Errors /// - /// Returns a [`ClientError::InvalidOperationAsBot`] if the current user is - /// a bot user. + /// If the `state` features is enabled, then this returns a + /// [`ClientError::InvalidOperationAsBot`] if the current user does not have + /// the required [permission]. /// /// [`ClientError::InvalidOperationAsBot`]: enum.ClientError.html#variant.InvalidOperationAsBot - /// [`Client::on_guild_create`]: ../client/struct.Client.html#method.on_guild_create /// [`Guild`]: struct.Guild.html + /// [`http::accept_invite`]: ../client/http/fn.accept_invite.html + /// [permission]: permissions/index.html #[cfg(feature="methods")] pub fn accept(&self) -> Result<Invite> { feature_state_enabled! {{ @@ -50,6 +49,7 @@ impl Invite { /// /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [permission]: permissions/index.html #[cfg(feature="methods")] pub fn delete(&self) -> Result<Invite> { let req = permissions::MANAGE_GUILD; @@ -64,11 +64,12 @@ impl Invite { impl RichInvite { /// Accepts the invite, placing the current user in the [`Guild`] that the - /// invite was for. This will fire the [`Client::on_guild_create`] handler - /// once the associated event is received. + /// invite was for. /// - /// Refer to the documentation for [`Invite::accept`] for restrictions on - /// accepting an invite. + /// Refer to [`http::accept_invite`] for more information. + /// + /// **Note**: This will fail if you are already in the guild, or are banned. + /// A ban is equivilant to an IP ban. /// /// **Note**: Requires that the current user be a user account. /// @@ -78,7 +79,8 @@ impl RichInvite { /// a bot user. /// /// [`ClientError::InvalidOperationAsBot`]: enum.ClientError.html#variant.InvalidOperationAsBot - /// [`Invite::accept`]: struct.Invite.html#method.accept + /// [`Guild`]: struct.Guild.html + /// [`http::accept_invite`]: ../client/http/fn.accept_invite.html #[cfg(feature="methods")] pub fn accept(&self) -> Result<Invite> { feature_state_enabled! {{ @@ -92,17 +94,21 @@ impl RichInvite { /// Deletes the invite. /// - /// Refer to the documentation for [`Invite::delete`] for restrictions on - /// deleting an invite. + /// Refer to [`http::delete_invite`] for more information. + /// + /// **Note**: Requires the [Manage Guild] permission. /// /// # Errors /// - /// Returns a [`ClientError::InvalidPermissions`] if the current user does - /// not have the required [permission]. + /// If the `state` feature is enabled, then this returns a + /// [`ClientError::InvalidPermissions`] if the current user does not have + /// the required [permission]. /// /// [`ClientError::InvalidPermissions`]: ../client/enum.ClientError.html#variant.InvalidPermissions /// [`Invite::delete`]: struct.Invite.html#method.delete + /// [`http::delete_invite`]: ../client/http/fn.delete_invite.html /// [Manage Guild]: permissions/constant.MANAGE_GUILD.html + /// [permission]: permissions/index.html #[cfg(feature="methods")] pub fn delete(&self) -> Result<Invite> { let req = permissions::MANAGE_GUILD; |