ForumTag

Forum tags can be applied to a thread of a forum channel.

Attributes

emoji : None, Emoji

The tag's emoji.

id : int

The tag's identifier.

moderated : bool

Whether this tag can only be added or removed by a user with manage_threads permission.

name : 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

__new__(name, ...)

Creates a new forum tag instance.

ParameterTypeOptionalKeyword onlyDescription
name

str

The tag's name.

emoji

None, Emoji

The tag's emoji.

moderated

bool

Whether this tag can only be added or removed by a user with manage_threads permission.

copy()

Copies the forum tag.

Returns

new : ForumTag

copy_with()

from_data(data)

Creates a new forum tag from the given data.

ParameterTypeDescription
data

dict of (str, object) items

Forum tag data.

Returns

self : ForumTag

precreate(...)

Precreates a new forum tag instance.

ParameterTypeOptionalKeyword onlyDescription
emoji

None, Emoji

The tag's emoji.

name

str

The tag's name.

moderated

bool

Whether this tag can only be added or removed by a user with manage_threads permission.

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_data(...)

Converts the forum tag to a json serializable object.

ParameterTypeOptionalKeyword onlyDefaultDescription
defaults

bool

False

Whether default values should be included as well.

include_internals

bool

False

Whether we want to include identifiers as well.

Returns

data : dict of (str, object) items

_create_empty(forum_tag_id)

Creates an empty forum tag with their default attributes set.

ParameterTypeDescription
forum_tag_id

int

The forum tag's identifier.

Returns

self : ForumTag

_create_or_difference_update(data)

Creates a forum tag. if it already exists calls ._difference_update_attributes on it.

ParameterTypeDescription
data

dict of (str, object) items

Forum tag data.

Returns

forum_tag_and_difference : ForumTag, (None, dict of (str, object) items)

_difference_update_attributes(data)

Updates the forum tag with the given data and returns the changed attributes in an attribute name - old value relation.

ParameterTypeDescription
data

dict of (str, object) items

Forum tag data.

Returns

old_attributes : dict of (str, object) items

The updated attributes.

Every item in the dictionary is optional.

KeysValues
emojiNone, Emoji
namestr
moderatedbool

_get_hash_partial()

Hashes the fields of the forum tag.

Returns

hash_value : int

_is_equal_same_type(other)

Returns whether the two types are equal.

Helper method for .__eq__

ParameterTypeDescription
other

instance<type<<self>>

The other instance. Must be from the same type.

Returns

is_equal : bool

_update_attributes(data)

Updates the forum tag with the given data.

ParameterTypeDescription
data

dict of (str, object) items

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