ThreadProfile

Represents an user's profile inside of a thread channel.

Attributes

user specific settings of the profile.

joined_at : None, datetime

The date when the user joined the thread.

Properties

created_at

Returns .joined_at if set, else the Discord epoch.

Returns

created_at : datetime

Methods

__new__(...)

Creates a new thread profile with the given parameters.

ParameterTypeOptionalKeyword onlyDescription
flags

ThreadProfileFlag, int

user specific settings of the profile.

joined_at

None, datetime

The date when the user joined the thread.

Raises

TypeError

  • If a parameter's type is incorrect.
  • Extra or unused parameters.

ValueError

  • If a parameter's value is incorrect.

copy()

Copies the thread profile.

Returns

new : instance<type<self>>

copy_with(...)

Copies the thread profile and modifies the defined the defined fields of it.

ParameterTypeOptionalKeyword onlyDescription
flags

ThreadProfileFlag, int

user specific settings of the profile.

joined_at

None, datetime

The date when the user joined the thread.

Returns

new : instance<type<self>>

Raises

TypeError

  • If a parameter's type is incorrect.
  • Extra or unused parameters.

ValueError

  • If a parameter's value is incorrect.

from_data(data)

Creates a thread profile from the given data.

ParameterTypeDescription
data

dict of (str, object) items

Received thread profile data.

Returns

self : instance<cls>

to_data(...)

Converts the thread profile to a json serializable object.

ParameterTypeOptionalKeyword onlyDefaultDescription
defaults

bool

False

Whether default values should be included as well.

include_internals

bool

False

Whether internal fields should be included as well.

Returns

data : dict of (str, object) items

_difference_update_attributes(data)

Updates the thread profile and returns it's changed attributes in a dict within attribute-name- old-value relation.

ParameterTypeDescription
data

dict of (str, object) items

Data received from Discord.

Returns

old_attributes : dict of (str, object) items

All item in the returned dict is optional.

Returned Data Structure

KeysValues
flagsThreadProfileFlag

_update_attributes(data)

Updates the thread profile with overwriting it's old attributes.

ParameterTypeDescription
data

dict of (str, object) items

Received thread profile data.

__eq__()

Returns whether the two thread profiles are equal.

__getattr__()

Drops a rich attribute error.

__hash__()

Returns the thread profile's hash value.

__repr__()

Returns the thread profile's representation.