Struct serenity::utils::CustomMessage [−][src]
pub struct CustomMessage { /* fields omitted */ }
Expand description
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)
.
pub fn attachments<It>(&mut self, attachments: It) -> &mut Self where
It: IntoIterator<Item = Attachment>,
pub fn attachments<It>(&mut self, attachments: It) -> &mut Self where
It: IntoIterator<Item = Attachment>,
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 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>,
pub fn mention_roles<It>(&mut self, roles: It) -> &mut Self where
It: IntoIterator<Item = RoleId>,
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
.
pub fn reactions<It>(&mut self, reactions: It) -> &mut Self where
It: IntoIterator<Item = MessageReaction>,
pub fn reactions<It>(&mut self, reactions: It) -> &mut Self where
It: IntoIterator<Item = MessageReaction>,
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).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for CustomMessage
impl Send for CustomMessage
impl Sync for CustomMessage
impl Unpin for CustomMessage
impl UnwindSafe for CustomMessage
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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