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

pub enum ReactionType {
    Custom {
        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

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]

[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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ReactionType
[src]

[src]

Formats the value using the given formatter.

impl Eq for ReactionType
[src]

impl PartialEq for ReactionType
[src]

[src]

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

[src]

This method tests for !=.

impl Hash for ReactionType
[src]

[src]

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

1.3.0
[src]

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

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

[src]

Deserialize this value from the given Serde deserializer. Read more

impl From<char> for ReactionType
[src]

[src]

Creates a ReactionType from a char.

Examples

Reacting to a message with an apple:

message.react('🍎')?;

impl From<Emoji> for ReactionType
[src]

[src]

Performs the conversion.

impl From<String> for ReactionType
[src]

[src]

Performs the conversion.

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

[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::ReactionType;

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

foo("🍎");

impl Display for ReactionType
[src]

[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.