Struct serenity::model::PrivateChannel [] [src]

pub struct PrivateChannel {
    pub id: ChannelId,
    pub last_message_id: Option<MessageId>,
    pub last_pin_timestamp: Option<DateTime<FixedOffset>>,
    pub kind: ChannelType,
    pub recipient: Arc<RwLock<User>>,
}

A Direct Message text channel with another user.

Fields

The unique Id of the private channel.

Can be used to calculate the first message's creation date.

The Id of the last message sent.

Timestamp of the last time a Message was pinned.

Indicator of the type of channel this is.

This should always be ChannelType::Private.

The recipient to the private channel.

Methods

impl PrivateChannel
[src]

[src]

Broadcasts that the current user is typing to the recipient.

[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 channel. This does not delete the contents of the channel, and is equivalent to closing a private channel on the client, which can be re-opened.

[src]

Deletes all messages by Ids from the given vector in the channel.

Refer to Channel::delete_messages for more information.

Requires the Manage Messages permission.

Note: This uses bulk delete endpoint which is not available for user accounts.

Note: Messages that are older than 2 weeks can't be deleted using this method.

[src]

Deletes all permission overrides in the channel from a member or role.

Note: Requires the Manage Channel permission.

[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.

Note: This method is for consistency. This will always return false, due to DMs not being considered NSFW.

[src]

Gets a message from the channel.

Requires the Read Message History permission.

[src]

Gets messages from the channel.

Refer to Channel::messages for more information.

Requires the Read Message History permission.

[src]

Returns "DM with $username#discriminator".

[src]

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

Refer to Channel::reaction_users for more information.

Note: Requires the Read Message History permission.

[src]

Pins a Message to the channel.

[src]

Retrieves the list of messages that have been pinned in the private channel.

[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 with the given content.

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

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 PrivateChannel
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for PrivateChannel
[src]

[src]

Formats the value using the given formatter.

impl Display for PrivateChannel
[src]

[src]

Formats the private channel, displaying the recipient's username.