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

pub struct CustomMessage { /* fields omitted */ }
Expand description

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

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.

Assign the dummy message a proper ID for identification.

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

Assign the dummy message files attached to it.

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

Assign the dummy message its author.

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

Assign the dummy message its origin channel’s ID.

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

Assign the dummy message its contents.

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

Assign the dummy message the timestamp it was edited.

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

Assign the dummy message embeds.

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

Assign the dummy message its origin guild’s ID.

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

Assign the dummy message its type.

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

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

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

If not used, the default value is false.

Assign the dummy message a list of roles it mentions.

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

Assign the dummy message a list of mentions.

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

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

If not used, the default value is false.

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

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

Assign the dummy message the timestamp it was created at.

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

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.

Assign the dummy message the webhook author’s ID.

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

Consume this builder and return the constructed message.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more