Icon

Represents a Discord Icon.

Attributes

hash : int

The icon's hash value.

type : IconType

The icon's type.

Properties

as_base_16_hash

Returns the discord side representation of the icon.

Returns

icon : None, str

as_base_64_data

Returns the base 64 version of the icon if applicable.

Returns

icon : None, str

Methods

__init__(icon_type, icon_hash)

Creates a new Icon object with the given attributes.

ParameterTypeDescription
icon_type

IconType

The icon's type.

icon_hash

int

The icon's hash value.

from_base16_hash()

Deprecated and will be removed in 2024 Marc. Please use from_base_16_hash. instead.

from_base_16_hash(icon)

Converts a discord icon hash value to an Icon object.

ParameterTypeDescription
icon

None, str

Discord icon hash.

Returns

self : Icon

__bool__()

__eq__()

Returns whether the two icons are equal.

__getattr__()

Drops a rich attribute error.

__hash__()

Returns the icon's hash.

__iter__()

Unpacks the icon.

This method is a generator.

__len__()

Length hinter (for unpacking if needed).

__repr__()

Returns the representation of the icon.