Stage

Represents an active stage instance of a stage channel.

Attributes

channel_id : int

The stage channel's identifier where the stage is active.

discoverable : bool

Whether the stage is discoverable. Only applies for public stages.

guild_id : int

The stage guild's identifier.

id : int

The stage instance's identifier.

invite_code : None, str

Invite code to the stage's channel.

privacy_level : PrivacyLevel

The privacy level of the stage.

scheduled_event_id : int

The scheduled event's identifier that started the stage.

topic : None, str

The topic of the stage. Can be empty string.

Properties

channel

Returns the stage's channel.

Returns

channel : None, Channel

created_at

When the entity was created.

Returns

created_at : datetime

guild

Returns the stage's guild.

Returns

guild : None, Guild

partial

Returns whether the stage is partial.

Returns

partial : bool

Methods

__new__(...)

Creates a partial stage with the given fields.

ParameterTypeOptionalKeyword onlyDescription
privacy_level

PrivacyLevel, int

The privacy level of the stage.

scheduled_event_id

int, ScheduledEvent

The scheduled event's identifier that started the stage.

topic

None, str

The topic of the stage. Can be empty string.

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

copy()

Copies the stage state.

Returns

new : instance<type<self>>

copy_with(...)

Copies the stage with the given fields.

ParameterTypeOptionalKeyword onlyDescription
privacy_level

PrivacyLevel, int

The privacy level of the stage.

scheduled_event_id

int, ScheduledEvent

The scheduled event's identifier that started the stage.

topic

None, str

The topic of the stage. Can be empty string.

Returns

new : instance<type<self>>

Raises

TypeError

  • If a parameter's value is incorrect.

ValueError

  • If a parameter's type is incorrect.

from_data(data, ...)

Creates a new stage instance from the received data.

ParameterTypeOptionalKeyword onlyDefaultDescription
data

dict of (str, object) items

Stage data.

strong_cache

bool

True

Whether the instance should be put into its strong cache.

Returns

self : instance<cls>

precreate(stage_id, ...)

Precreates the stage by creating a partial one with the given parameters. When the stage is loaded the precreated one will be picked up. If an already existing stage would be precreated, returns that instead and updates that only, if that is partial.

ParameterTypeOptionalKeyword onlyDescription
stage_id

int

The stage's identifier.

**keyword_parameters

keyword parameters

Additional predefined attributes for the stage.

channel

int, Channel

Alternative for channel_id.

channel_id

int, Channel

The stage channel or its identifier where the stage is active.

discoverable

bool

Whether the stage is discoverable. Only applies for public stages.

guild

int, Guild

Alternative for guild_id.

guild_id

int, Guild

The stage's guild or its identifier.

invite_code

None, str

Invite code to the stage's channel.

privacy_level

PrivacyLevel, int

The privacy level of the stage.

scheduled_event

int, ScheduledEvent

Alternative for scheduled_event_id.

scheduled_event_id

int, ScheduledEvent

The scheduled event or its identifier that started the stage.

topic

None, str

The topic of the stage. Can be empty string.

Returns

self : instance<cls>

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

to_data(...)

Serialises the stage to 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(stage_id)

Creates a stage instance with its attributes set to their default values.

ParameterTypeDescription
stage_id

int

The stage's identifier.

Returns

self : instance<cls>

_delete()

Removes the stage's references.

_difference_update_attributes(data)

Updates the stage from the given data and returns the changed attributes in attribute-name- old-value relation.

ParameterTypeDescription
data

dict of (str, object) items

Stage data.

Returns

old_attributes : dict of (str, object) items

The changed attributes of the stage.

Each item in the returned dictionary is optional.

Returned Data Structure

KeysValues
discoverablebool
invite_codeNone, str
privacy_levelPrivacyLevel
topicNone, str

_get_hash_partial()

Returns the stage's hash value. This function is called when the stage is partial.

Returns

hash_value : int

_is_equal_same_type(other)

Returns whether self is equal to other. Other must be same type as self.

ParameterTypeDescription
other

instance<type<self>>

The other instance.

Returns

is_equal : bool

_set_attributes(data)

Sets the stage's attributes from the given data. Excludes .id.

ParameterTypeDescription
data

dict of (str, object) items

Stage data.

_update_attributes(data)

Updates the stage from the given data.

ParameterTypeDescription
data

dict of (str, object) items

Stage data.

__eq__()

Returns whether the two stages are equal.

__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__()

Hashes the stage.

__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__()

Returns whether the two stages are not equal.

__repr__()

Returns the stage's representation.