ScheduledEvent
Attributes
int
The event's stage's channel identifier.
The event's creator.
None
, str
Description of the event.
None
, datetime
The scheduled end time of the event.
int
The event's entity's identifier.
Metadata about the target entity.
To which type of entity the event is bound to.
int
The respective event's identifier.
int
The scheduled event's identifier number.
int
The event's image hash.
The event's image's type.
str
The event's name.
The privacy level of the event.
None
, tuple
of int
Stock keeping unit identifiers used at the event.
None
, datetime
The scheduled start time of the event.
The status of the event.
int
Users subscribed to the event.
Notes
Scheduled event instances support weakreferencing.
Properties
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
guild
image
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
Methods
(...)
__new__Creates a new partial scheduled event with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
channel_id |
| The event's stage's channel or its identifier. | ||
description |
| Description of the event. | ||
end |
| The scheduled end time of the event. | ||
entity_type | To which type of entity the event is bound to. | |||
image |
| The schedule event's image. | ||
name |
| The event's name. | ||
privacy_level |
| The privacy level of the event. | ||
start |
| The scheduled start time of the event. | ||
status | The status of the event. | |||
**keyword_parameters | Keyword parameters | Additional keyword parameters passed to the entity metadata. | ||
location |
| The place where the event will take place. | ||
speaker_ids |
| 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.
()
copyCopies the scheduled event.
Returns
new : instance<type<self>>
(...)
copy_withCopies the scheduled event with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
channel_id |
| The event's stage's channel or its identifier. | ||
description |
| Description of the event. | ||
end |
| The scheduled end time of the event. | ||
entity_type | To which type of entity the event is bound to. | |||
image |
| The schedule event's image. | ||
name |
| The event's name. | ||
privacy_level |
| The privacy level of the event. | ||
start |
| The scheduled start time of the event. | ||
status | The status of the event. | |||
**keyword_parameters | Keyword parameters | Additional keyword parameters passed to the entity metadata. | ||
location |
| The place where the event will take place. | ||
speaker_ids |
| 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.
(data, ...)
from_dataCreates a new scheduled event instance from the received data.
If the instance already exists, returns that instead.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
data |
| Guild scheduled event data. | |||
strong_cache |
|
| Whether the instance should be put into its strong cache. |
Returns
self : instance<cls>
(data)
from_data_is_createdCreates 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.
Parameter | Type | Description |
---|---|---|
data |
| Guild scheduled event data. |
Returns
self : instance<cls>
is_created : bool
(...)
image_url_asReturns 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.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
ext |
|
| The extension of the image's url. Can be any of: | |
size |
|
| 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_idsIterates over the stock keeping unit identifiers used at the event.
This method is an iterable generator.
Yields
sku_id : int
(scheduled_event_id, ...)
precreatePrecreates 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.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
scheduled_event_id |
| The scheduled event's identifier. | ||
entity_type | To which type of entity the event is bound to. | |||
**keyword_parameters | keyword parameters | Additional predefined attributes for the scheduled event. | ||
channel_id |
| Alternative for | ||
channel_id |
| The event's stage's channel or its identifier. | ||
creator | The event's creator. | |||
description |
| Description of the event. | ||
end |
| The scheduled end time of the event. | ||
entity_id |
| The event's entity's identifier. | ||
entity_type | To which type of entity the event is bound to. | |||
guild |
| Alternative for | ||
guild_id |
| The scheduled event's guild or its identifier. | ||
image |
| The schedule event's image. | ||
location |
| The place where the event will take place. | ||
name |
| The event's name. | ||
privacy_level |
| The privacy level of the event. | ||
sku_ids |
| Stock keeping unit identifiers used at the event. | ||
speaker_ids |
| The speakers' identifier of the stage channel. | ||
start |
| The scheduled start time of the event. | ||
status | The status of the event. | |||
user_count |
| 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_dataConverts the scheduled event to a json serializable object.
Parameter | Type | Optional | Keyword only | Default | Description |
---|---|---|---|---|---|
defaults |
|
| Whether fields with their default value should be included as well. | ||
include_internals |
|
| Whether internal fields should be included as well. |
Returns
data : dict
of (str
, object
) items
(scheduled_event_id)
_create_emptyCreates a scheduled event instance with its attributes set to their default values.
Parameter | Type | Description |
---|---|---|
scheduled_event_id |
| The stage's identifier. |
Returns
self : instance<cls>
(data)
_create_from_data_and_deleteCreates a new scheduled event instance from the received data.
If the instance already exists, returns that instead.
Parameter | Type | Description |
---|---|---|
data |
| Guild event data. |
Returns
self : instance<cls>
The created or found scheduled event instance.
()
_deleteTries to delete the scheduled event from its guild.
Returns
deleted : bool
(data)
_difference_update_attributesUpdates the attributes of the scheduled event and returns the changed ones within an attribute-name
- old-value
relation.
Parameter | Type | Description |
---|---|---|
data |
| Scheduled event data. |
Returns
old_attributes : dict
of (str
, object
) items
The updated attributes.
The returned dictionary might contain the following items:
Key | Value |
---|---|
channel_id | int |
description | None , str |
end | None , datetime |
entity_id | int |
entity_metadata | ScheduledEventEntityMetadataBase |
entity_type | ScheduledEventEntityType |
image | Icon |
name | str |
privacy_level | PrivacyLevel |
sku_ids | None , tuple of int |
start | None , datetime |
status | ScheduledEventStatus |
()
_get_hash_partialReturns the scheduled event's hash value. This function is called when the scheduled event is partial.
Returns
hash_value : int
(other)
_is_equal_same_typeReturns whether self is equal to other. Other must be same type as self.
Parameter | Type | Description |
---|---|---|
other |
| The other instance. |
Returns
is_equal : bool
(data)
_set_attributesSets the event's attributes form the received data.
Parameter | Type | Description |
---|---|---|
data |
| Scheduled event data. |
(data)
_update_attributesUpdates the attributes of the scheduled event.
Parameter | Type | Description |
---|---|---|
data |
| Scheduled event data. |
(data)
_update_counts_onlyUpdates the scheduled event's count attributes only.
Parameter | Type | Description |
---|---|---|
data |
| 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.