Enum serenity::model::channel::ReactionType[][src]

pub enum ReactionType {
    Custom {
        animated: bool,
        id: EmojiId,
        name: Option<String>,
    },
    Unicode(String),
}

The type of a Reaction sent.

Variants

A reaction with a Guilds custom Emoji, which is unique to the guild.

Fields of Custom

Whether the emoji is animated.

The Id of the custom Emoji.

The name of the custom emoji. This is primarily used for decoration and distinguishing the emoji client-side.

A reaction with a twemoji.

Methods

impl ReactionType
[src]

Creates a data-esque display of the type. This is not very useful for displaying, as the primary client can not render it, but can be useful for debugging.

Note: This is mainly for use internally. There is otherwise most likely little use for it.

Trait Implementations

impl Clone for ReactionType
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for ReactionType
[src]

Formats the value using the given formatter. Read more

impl Eq for ReactionType
[src]

impl PartialEq for ReactionType
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Hash for ReactionType
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<'de> Deserialize<'de> for ReactionType
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Serialize for ReactionType
[src]

Serialize this value into the given Serde serializer. Read more

impl From<char> for ReactionType
[src]

Creates a ReactionType from a char.

Examples

Reacting to a message with an apple:

message.react('🍎')?;

impl From<Emoji> for ReactionType
[src]

Performs the conversion.

impl From<EmojiId> for ReactionType
[src]

Performs the conversion.

impl From<EmojiIdentifier> for ReactionType
[src]

Performs the conversion.

impl From<String> for ReactionType
[src]

Performs the conversion.

impl<'a> From<&'a str> for ReactionType
[src]

Creates a ReactionType from a string slice.

Examples

Creating a ReactionType from a 🍎, modeling a similar API as the rest of the library:

use serenity::model::channel::ReactionType;

fn foo<R: Into<ReactionType>>(bar: R) {
    println!("{:?}", bar.into());
}

foo("🍎");

impl FromStr for ReactionType
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Display for ReactionType
[src]

Formats the reaction type, displaying the associated emoji in a way that clients can understand.

If the type is a custom emoji, then refer to the documentation for emoji's formatter on how this is displayed. Otherwise, if the type is a unicode, then the inner unicode is displayed.

Auto Trait Implementations