#[non_exhaustive]pub enum EmbedType {
Rich,
Image,
Video,
Gifv,
Article,
Link,
AutoModerationMessage,
PollResult,
Components,
Unknown(CompactString),
}Expand description
The type of an embed.
discord.js counterpart: EmbedType.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Rich
A generic embed rendered from its fields (the only type bots can send).
Image
An image.
Video
A video.
Gifv
An animated GIF rendered as a video.
Article
An article.
Link
A link.
AutoModerationMessage
An auto moderation alert in the alert channel.
Undocumented: known from discord-api-types, not in the official docs; may change without notice.
PollResult
The result of a poll, in the message announcing it; the data is in
the fields (poll_question_text, victor_answer_votes,
total_votes, victor_answer_id, victor_answer_text, victor_answer_emoji_id,
victor_answer_emoji_name, victor_answer_emoji_animated).
Components
Unknown(CompactString)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
EmbedType::from over constructing this variant directly.
Implementations§
Source§impl EmbedType
impl EmbedType
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the string Discord uses for this value.
discord.js counterpart: the enum’s string value in discord-api-types.
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true for a value this version of the library does not know about.
discord.js counterpart: none (discord.js passes unknown strings through).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EmbedType
impl<'de> Deserialize<'de> for EmbedType
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for EmbedType
Source§impl Ord for EmbedType
impl Ord for EmbedType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for EmbedType
impl RefUnwindSafe for EmbedType
impl Send for EmbedType
impl Sync for EmbedType
impl Unpin for EmbedType
impl UnsafeUnpin for EmbedType
impl UnwindSafe for EmbedType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more