Enum serenity::model::Channel [] [src]

pub enum Channel {
    Group(Arc<RwLock<Group>>),
    Guild(Arc<RwLock<GuildChannel>>),
    Private(Arc<RwLock<PrivateChannel>>),
    Category(Arc<RwLock<ChannelCategory>>),
}

A container for any channel.

Variants

A group. A group comprises of only one channel.

A text or voice channel within a Guild.

A private channel to another User. No other users may access the channel. For multi-user "private channels", use a group.

A category of GuildChannels

Methods

impl Channel
[src]

[src]

React to a Message with a custom Emoji or unicode character.

Message::react may be a more suited method of reacting in most cases.

Requires the Add Reactions permission, if the current user is the first user to perform a react with a certain emoji.

[src]

Deletes the inner channel.

Note: There is no real function as deleting a Group. The closest functionality is leaving it.

[src]

Deletes a Message given its Id.

Refer to Message::delete for more information.

Requires the Manage Messages permission, if the current user is not the author of the message.

[src]

Deletes the given Reaction from the channel.

Note: Requires the Manage Messages permission, if the current user did not perform the reaction.

[src]

Edits a Message in the channel given its Id.

Message editing preserves all unchanged message data.

Refer to the documentation for CreateMessage for more information regarding message restrictions and requirements.

Note: Requires that the current user be the author of the message.

Errors

Returns a ModelError::MessageTooLong if the content of the message is over the the limit, containing the number of unicode code points over the limit.

[src]

Determines if the channel is NSFW.

Refer to utils::is_nsfw for more details.

[src]

Gets a message from the channel.

Requires the Read Message History permission.

[src]

Gets messages from the channel.

Requires the Read Message History permission.

Examples

Be careful when using this code, it's not being tested!
use serenity::model::MessageId;

let id = MessageId(81392407232380928);

// Maximum is 100.
let _messages = channel.messages(|g| g.after(id).limit(100));

[src]

Gets the list of Users who have reacted to a Message with a certain Emoji.

The default limit is 50 - specify otherwise to receive a different maximum number of users. The maximum that may be retrieve at a time is 100, if a greater number is provided then it is automatically reduced.

The optional after attribute is to retrieve the users after a certain user. This is useful for pagination.

Note: Requires the Read Message History permission.

[src]

Retrieves the Id of the inner Group, GuildChannel, or PrivateChannel.

[src]

Sends a message with just the given message content in the channel.

Errors

Returns a ModelError::MessageTooLong if the content of the message is over the above limit, containing the number of unicode code points over the limit.

[src]

Sends (a) file(s) along with optional message contents.

Refer to ChannelId::send_files for examples and more information.

The Attach Files and Send Messages permissions are required.

Note: Message contents must be under 2000 unicode code points.

Errors

If the content of the message is over the above limit, then a ClientError::MessageTooLong will be returned, containing the number of unicode code points over the limit.

[src]

Sends a message to the channel.

Refer to the documentation for CreateMessage for more information regarding message restrictions and requirements.

The Send Messages permission is required.

Note: Message contents must be under 2000 unicode code points.

Errors

Returns a ModelError::MessageTooLong if the content of the message is over the above limit, containing the number of unicode code points over the limit.

[src]

Unpins a Message in the channel given by its Id.

Requires the Manage Messages permission.

Trait Implementations

impl Clone for Channel
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Channel
[src]

[src]

Formats the value using the given formatter.

impl<'de> Deserialize<'de> for Channel
[src]

[src]

Deserialize this value from the given Serde deserializer. Read more

impl Display for Channel
[src]

[src]

Formats the channel into a "mentioned" string.

This will return a different format for each type of channel:

impl Mentionable for Channel
[src]

[src]

Creates a mentionable string, that will be able to notify and/or create a link to the item. Read more

impl FromStr for Channel
[src]

The associated error which can be returned from parsing.

[src]

Parses a string s to return a value of this type. Read more