Reaction

Represents a reaction.

Attributes

emoji

type

Parameters

emoji : Emoji

The reaction emoji,

reaction_type : ReactionType

The reaction's type

Methods

__new__(emoji, ...)

Creates a new new reaction with the given parameters.

ParameterTypeOptionalKeyword onlyDescription
emoji

Emoji

The reaction emoji,

reaction_type

ReactionType, int

The reaction's type.

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

copy()

Copies the reaction returning a new one.

Returns

new : instance<type<self>>

copy_with(...)

Copies the reaction with the given fields.

ParameterTypeOptionalKeyword onlyDescription
emoji

Emoji

The reaction emoji,

reaction_type

ReactionType

The reaction's type.

Returns

new : instance<type<self>>

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

from_data(data)

Creates a new reaction.

ParameterTypeDescription
data

dict<str, object>

Reaction data.

Returns

self : instance<cls>

from_fields(emoji, reaction_type)

Creates a new reaction from the given fields. Not like .__new__, this has no validation.

ParameterTypeDescription
emoji

Emoji

The reaction emoji,

reaction_type

ReactionType

The reaction's type

Returns

self : instance<cls>

to_data(...)

Serializes the reaction field.

ParameterTypeOptionalKeyword onlyDefaultDescription
defaults

bool

False

Whether fields of their default value should be included as well.

Returns

data : dict<str, object>

__eq__()

Returns whether the two reaction's are equal.

__getattr__()

Drops a rich attribute error.

__hash__()

returns the reaction's hash value.

__repr__()

Returns the reaction's representation.