pub struct Message {
pub id: Option<DiscordID>,
pub content: Option<String>,
pub username: Option<String>,
pub avatar_url: Option<String>,
pub tts: Option<bool>,
pub embeds: Option<Vec<Embed>>,
pub poll: Option<PollCreate>,
pub flags: Option<MessageFlags>,
}Fields§
§id: Option<DiscordID>§content: Option<String>The message contents (up to 2000 characters)
username: Option<String>Override the default username of the webhook
avatar_url: Option<String>Override the default avatar of the webhook
tts: Option<bool>Enables Text-To-Speech
embeds: Option<Vec<Embed>>Vector of up to 10 Embed objects
poll: Option<PollCreate>Well, a pool
flags: Option<MessageFlags>Message flags combined as a bitfield
(only suppress_embeds and suppress_notifications can be set can be set by webhooks)
Implementations§
Source§impl Message
impl Message
pub fn new<Func>(function: Func) -> Self
pub fn content(self, content: impl Into<String>) -> Self
pub fn username(self, username: impl Into<String>) -> Self
pub fn avatar_url(self, avatar_url: impl Into<String>) -> Self
pub fn tts(self, tts: bool) -> Self
pub fn embed<Func>(self, function: Func) -> Self
pub fn poll<Func1, Func2>(self, title: Func1, content: Func2) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more