[][src]Struct serenity::utils::CustomMessage

pub struct CustomMessage { /* fields omitted */ }

A builder for constructing a personal Message instance. This can be useful for emitting a manual dispatch to the framework, but you don't have a message in hand, or just have a fragment of its data.

Implementations

impl CustomMessage[src]

pub fn new() -> Self[src]

Constructs a new instance of this builder, alongside a message with dummy data. Use the methods to replace the individual bits of this message with valid data.

pub fn id(&mut self, id: MessageId) -> &mut Self[src]

Assign the dummy message a proper ID for identification.

If not used, the default value is MessageId(0).

pub fn attachments<It>(&mut self, attachments: It) -> &mut Self where
    It: IntoIterator<Item = Attachment>, 
[src]

Assign the dummy message files attached to it.

If not used, the default value is an empty vector (Vec::default()).

pub fn author(&mut self, user: User) -> &mut Self[src]

Assign the dummy message its author.

If not used, the default value is a dummy User.

pub fn channel_id(&mut self, channel_id: ChannelId) -> &mut Self[src]

Assign the dummy message its origin channel's ID.

If not used, the default value is ChannelId(0).

pub fn content<T: ToString>(&mut self, s: T) -> &mut Self[src]

Assign the dummy message its contents.

If not used, the default value is an empty string (String::default()).

pub fn edited_timestamp(&mut self, timestamp: DateTime<Utc>) -> &mut Self[src]

Assign the dummy message the timestamp it was edited.

If not used, the default value is None (not all messages are edited).

pub fn embeds<It>(&mut self, embeds: It) -> &mut Self where
    It: IntoIterator<Item = Embed>, 
[src]

Assign the dummy message embeds.

If not used, the default value is an empty vector (Vec::default()).

pub fn guild_id(&mut self, guild_id: GuildId) -> &mut Self[src]

Assign the dummy message its origin guild's ID.

If not used, the default value is None (not all messages are sent in guilds).

pub fn kind(&mut self, kind: MessageType) -> &mut Self[src]

Assign the dummy message its type.

If not used, the default value is MessageType::Regular.

pub fn member(&mut self, member: PartialMember) -> &mut Self[src]

Assign the dummy message member data pertaining to its author.

If not used, the default value is None (not all messages are sent in guilds).

pub fn mention_everyone(&mut self, mentions: bool) -> &mut Self[src]

Assign the dummy message a flag whether it mentions everyone (@everyone).

If not used, the default value is false.

pub fn mention_roles<It>(&mut self, roles: It) -> &mut Self where
    It: IntoIterator<Item = RoleId>, 
[src]

Assign the dummy message a list of roles it mentions.

If not used, the default value is an empty vector (Vec::default()).

pub fn mentions<It>(&mut self, mentions: It) -> &mut Self where
    It: IntoIterator<Item = User>, 
[src]

Assign the dummy message a list of mentions.

If not used, the default value is an empty vector (Vec::default()).

pub fn pinned(&mut self, pinned: bool) -> &mut Self[src]

Assign the dummy message a flag whether it's been pinned.

If not used, the default value is false.

pub fn reactions<It>(&mut self, reactions: It) -> &mut Self where
    It: IntoIterator<Item = MessageReaction>, 
[src]

Assign the dummy message a list of emojis it was reacted with.

If not used, the default value is an empty vector (Vec::default()).

pub fn timestamp(&mut self, timestamp: DateTime<Utc>) -> &mut Self[src]

Assign the dummy message the timestamp it was created at.

If not used, the default value is the current local time.

pub fn tts(&mut self, tts: bool) -> &mut Self[src]

Assign the dummy message a flag whether it'll be read by a Text-To-Speech program.

If not used, the default value is false.

pub fn webhook_id(&mut self, id: WebhookId) -> &mut Self[src]

Assign the dummy message the webhook author's ID.

If not used, the default value is None (not all messages are sent by webhooks).

pub fn build(self) -> Message[src]

Consume this builder and return the constructed message.

Trait Implementations

impl Clone for CustomMessage[src]

impl Debug for CustomMessage[src]

impl Default for CustomMessage[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]