ScheduledEvent

Attributes

channel_id : int

The event's stage's channel identifier.

creator : ClientUserBase

The event's creator.

description : None, str

Description of the event.

end : None, datetime

The scheduled end time of the event.

entity_id : int

The event's entity's identifier.

Metadata about the target entity.

To which type of entity the event is bound to.

guild_id : int

The respective event's identifier.

id : int

The scheduled event's identifier number.

image_hash : int

The event's image hash.

image_type : IconType

The event's image's type.

name : str

The event's name.

privacy_level : PrivacyLevel

The privacy level of the event.

sku_ids : None, tuple of int

Stock keeping unit identifiers used at the event.

start : None, datetime

The scheduled start time of the event.

The status of the event.

user_count : int

Users subscribed to the event.

Notes

Scheduled event instances support weakreferencing.

Properties

channel

Returns the event's channel if has any.

Returns

channel : None, Channel

created_at

When the entity was created.

Returns

created_at : datetime

creator_id

The event's creator's identifier.

Returns

user_id : int

entity

Returns the stage channel's entity if applicable.

Returns

entity : None, Channel

guild

Returns the event's guild.

Returns

guild : None, Guild

image

Returns the respective icon.

Returns

icon : Icon

image_url

Returns the scheduled event's image's url. If the scheduled event has no image, then returns None.

This function is a property of ScheduledEvent-s.

Returns

url : None, str

partial

Returns whether the scheduled event is partial.

Returns

partial : bool

url

Returns the scheduled event's url.

This function is a property of ScheduledEvent-s.

Returns

url : str

Methods

__new__(...)

Creates a new partial scheduled event with the given fields.

ParameterTypeOptionalKeyword onlyDescription
channel_id

int, Channel

The event's stage's channel or its identifier.

description

None, str

Description of the event.

end

None, datetime

The scheduled end time of the event.

entity_type

ScheduledEventEntityType, int

To which type of entity the event is bound to.

image

None, Icon, str, bytes-like

The schedule event's image.

name

str

The event's name.

privacy_level

PrivacyLevel, int

The privacy level of the event.

start

None, datetime

The scheduled start time of the event.

status

ScheduledEventStatus

The status of the event.

**keyword_parameters

Keyword parameters

Additional keyword parameters passed to the entity metadata.

location

None, str

The place where the event will take place.

speaker_ids

None, iterable of (int, ClientUserBase)

The speakers' identifier of the stage channel.

Raises

TypeError

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

ValueError

  • If a parameter's value is incorrect.

copy()

Copies the scheduled event.

Returns

new : instance<type<self>>

copy_with(...)

Copies the scheduled event with the given fields.

ParameterTypeOptionalKeyword onlyDescription
channel_id

int, Channel

The event's stage's channel or its identifier.

description

None, str

Description of the event.

end

None, datetime

The scheduled end time of the event.

entity_type

ScheduledEventEntityType, int

To which type of entity the event is bound to.

image

None, Icon, str, bytes-like

The schedule event's image.

name

str

The event's name.

privacy_level

PrivacyLevel, int

The privacy level of the event.

start

None, datetime

The scheduled start time of the event.

status

ScheduledEventStatus

The status of the event.

**keyword_parameters

Keyword parameters

Additional keyword parameters passed to the entity metadata.

location

None, str

The place where the event will take place.

speaker_ids

None, iterable of (int, ClientUserBase)

The speakers' identifier of the stage channel.

Returns

new : instance<type<self>>

Raises

TypeError

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

ValueError

  • If a parameter's type is incorrect.

from_data(data, ...)

Creates a new scheduled event instance from the received data.

If the instance already exists, returns that instead.

ParameterTypeOptionalKeyword onlyDefaultDescription
data

dict of (str, object) items

Guild scheduled event data.

strong_cache

bool

True

Whether the instance should be put into its strong cache.

Returns

self : instance<cls>

from_data_is_created(data)

Creates a new scheduled event instance from the received data. If already exists, picks it up.

Also returns whether the instance was new (or partial) or already existed.

ParameterTypeDescription
data

dict of (str, object) items

Guild scheduled event data.

Returns

self : instance<cls> is_created : bool

image_url_as(...)

Returns the scheduled event's image's url. If the scheduled event has no image, then returns None.

This function is a method of ScheduledEvent-s.

ParameterTypeOptionalDefaultDescription
ext

None, str

None

The extension of the image's url. Can be any of: 'jpg', 'jpeg', 'png', 'webp'.

size

None, int

None

The preferred minimal size of the image's url.

Returns

url : None, str

Raises

ValueError

If ext, size was not passed as any of the expected values.

iter_sku_ids()

Iterates over the stock keeping unit identifiers used at the event.

This method is an iterable generator.

Yields

sku_id : int

precreate(scheduled_event_id, ...)

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

ParameterTypeOptionalKeyword onlyDescription
scheduled_event_id

int

The scheduled event's identifier.

entity_type

ScheduledEventEntityType, int

To which type of entity the event is bound to.

**keyword_parameters

keyword parameters

Additional predefined attributes for the scheduled event.

channel_id

int, Channel

Alternative for channel.

channel_id

int, Channel

The event's stage's channel or its identifier.

creator

ClientUserBase

The event's creator.

description

None, str

Description of the event.

end

None, datetime

The scheduled end time of the event.

entity_id

int

The event's entity's identifier.

entity_type

ScheduledEventEntityType, int

To which type of entity the event is bound to.

guild

int, Guild

Alternative for guild_id.

guild_id

int, Guild

The scheduled event's guild or its identifier.

image

None, Icon, str

The schedule event's image.

location

None, str

The place where the event will take place.

name

str

The event's name.

privacy_level

PrivacyLevel, int

The privacy level of the event.

sku_ids

None, iterable of int

Stock keeping unit identifiers used at the event.

speaker_ids

None, iterable of (int, ClientUserBase)

The speakers' identifier of the stage channel.

start

None, datetime

The scheduled start time of the event.

status

ScheduledEventStatus

The status of the event.

user_count

int

Users subscribed to the event.

Returns

self : instance<cls>

Raises

TypeError

  • If a parameter's type is incorrect.

ValueError

  • If a parameter's value is incorrect.

to_data(...)

Converts the scheduled event to a json serializable object.

ParameterTypeOptionalKeyword onlyDefaultDescription
defaults

bool

False

Whether fields with their default value should be included as well.

include_internals

bool

False

Whether internal fields should be included as well.

Returns

data : dict of (str, object) items

_create_empty(scheduled_event_id)

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

ParameterTypeDescription
scheduled_event_id

int

The stage's identifier.

Returns

self : instance<cls>

_create_from_data_and_delete(data)

Creates a new scheduled event instance from the received data.

If the instance already exists, returns that instead.

ParameterTypeDescription
data

dict of (str, object) items

Guild event data.

Returns

self : instance<cls>

The created or found scheduled event instance.

_delete()

Tries to delete the scheduled event from its guild.

Returns

deleted : bool

_difference_update_attributes(data)

Updates the attributes of the scheduled event and returns the changed ones within an attribute-name- old-value relation.

ParameterTypeDescription
data

dict of (str, object) items

Scheduled event data.

Returns

old_attributes : dict of (str, object) items

The updated attributes.

The returned dictionary might contain the following items:

KeyValue
channel_idint
descriptionNone, str
endNone, datetime
entity_idint
entity_metadataScheduledEventEntityMetadataBase
entity_typeScheduledEventEntityType
imageIcon
namestr
privacy_levelPrivacyLevel
sku_idsNone, tuple of int
startNone, datetime
statusScheduledEventStatus

_get_hash_partial()

Returns the scheduled event's hash value. This function is called when the scheduled event 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 event's attributes form the received data.

ParameterTypeDescription
data

dict of (str, object) items

Scheduled event data.

_update_attributes(data)

Updates the attributes of the scheduled event.

ParameterTypeDescription
data

dict of (str, object) items

Scheduled event data.

_update_counts_only(data)

Updates the scheduled event's count attributes only.

ParameterTypeDescription
data

dict of (str, object) items

Scheduled event data.

__eq__()

Returns whether the two scheduled events 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__()

Returns the scheduled event's hash value.

__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 scheduled events are not equal.

__repr__()

Returns the guild event's representation.