ForumTag
Forum tags can be applied to a thread of a forum channel.
Attributes
None
, Emoji
The tag's emoji.
int
The tag's identifier.
bool
Whether this tag can only be added or removed by a user with manage_threads
permission.
str
The tag's name.
Properties
created_at
When the entity was created.
Returns
created_at : datetime
partial
Returns whether the forum tag is partial.
Returns
partial : bool
Methods
(name, ...)
__new__Creates a new forum tag instance.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
name |
| The tag's name. | ||
emoji |
| The tag's emoji. | ||
moderated |
| Whether this tag can only be added or removed by a user with |
()
copy()
copy_with(data)
from_dataCreates a new forum tag from the given data.
Parameter | Type | Description |
---|---|---|
data |
| Forum tag data. |
Returns
self : ForumTag
(...)
precreatePrecreates a new forum tag instance.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
emoji |
| The tag's emoji. | ||
name |
| The tag's name. | ||
moderated |
| Whether this tag can only be added or removed by a user with |
Returns
forum_tag : ForumTag
Raises
TypeError
If any parameter's type is bad or if unexpected parameter is passed.
ValueError
If an parameter's type is good, but it's value is unacceptable.
(...)
to_dataConverts the forum tag to a json serializable object.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether default values should be included as well. | ||
include_internals |
|
| Whether we want to include identifiers as well. |
Returns
data : dict
of (str
, object
) items
(forum_tag_id)
_create_emptyCreates an empty forum tag with their default attributes set.
Parameter | Type | Description |
---|---|---|
forum_tag_id |
| The forum tag's identifier. |
Returns
self : ForumTag
(data)
_create_or_difference_updateCreates a forum tag. if it already exists calls ._difference_update_attributes
on it.
Parameter | Type | Description |
---|---|---|
data |
| Forum tag data. |
Returns
forum_tag_and_difference : ForumTag
, (None
, dict
of (str
, object
) items)
(data)
_difference_update_attributesUpdates the forum tag with the given data and returns the changed attributes in an attribute name - old value
relation.
Parameter | Type | Description |
---|---|---|
data |
| Forum tag data. |
Returns
old_attributes : dict
of (str
, object
) items
The updated attributes.
Every item in the dictionary is optional.
Keys | Values |
---|---|
emoji | None , Emoji |
name | str |
moderated | bool |
()
_get_hash_partialHashes the fields of the forum tag.
Returns
hash_value : int
(other)
_is_equal_same_typeReturns whether the two types are equal.
Helper method for .__eq__
Parameter | Type | Description |
---|---|---|
other |
| The other instance. Must be from the same type. |
Returns
is_equal : bool
(data)
_update_attributesUpdates the forum tag with the given data.
Parameter | Type | Description |
---|---|---|
data |
| Forum tag data. |
()
__eq__Whether this entity's id is equal as the other's.
()
__ge__Whether this entity's id is greater or equal than the other's.
()
__getattr__Drops a rich attribute error.
()
__gt__Whether this entity's id is greater than the other's.
()
__hash__Returns the has value of the entity, what equals to it's id.
()
__le__Whether this entity's id is less or equal than the other's.
()
__lt__Whether this entity's id is less than the other's.
()
__ne__Whether this entity's id is not equal as the other's.
()
__repr__Return repr(self).