Reaction
Represents a reaction.
Attributes
Parameters
emoji : Emoji
The reaction emoji,
reaction_type : ReactionType
The reaction's type
Methods
(emoji, ...)
__new__Creates a new new reaction with the given parameters.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
emoji | The reaction emoji, | |||
reaction_type |
| The reaction's type. |
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
()
copyCopies the reaction returning a new one.
Returns
new : instance<type<self>>
(...)
copy_withCopies the reaction with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
emoji | The reaction emoji, | |||
reaction_type | 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.
(data)
from_dataCreates a new reaction.
Parameter | Type | Description |
---|---|---|
data |
| Reaction data. |
Returns
self : instance<cls>
(emoji, reaction_type)
from_fieldsCreates a new reaction from the given fields. Not like .__new__
, this has no validation.
Parameter | Type | Description |
---|---|---|
emoji | The reaction emoji, | |
reaction_type | The reaction's type |
Returns
self : instance<cls>
(...)
to_dataSerializes the reaction field.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| 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.