[−][src]Struct serenity::utils::CustomMessage
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]
It: IntoIterator<Item = Attachment>,
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]
It: IntoIterator<Item = Embed>,
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]
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()
).
pub fn mentions<It>(&mut self, mentions: It) -> &mut Self where
It: IntoIterator<Item = User>,
[src]
It: IntoIterator<Item = User>,
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]
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()
).
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]
fn clone(&self) -> CustomMessage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CustomMessage
[src]
impl Default for CustomMessage
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,