Guiwd Scheduwed Events¶
This section documents evewything wewated to Guiwd Scheduwed Events.
Discowd Modews¶
GuiwdScheduwedEvent¶
- class disnake.GuildScheduledEvent[source]¶
Wepwesents a guiwd scheduwed event.
Nyew in vewsion 2.3.
- x == y
Checks if two guiwd scheduwed events awe equaw.
- x != y
Checks if two guiwd s-scheduwed events awe nyot equaw.
- hash(x)
Wetuwns the guiwd scheduwed event’s hash.
- channel_id¶
The channyew ID in which the guiwd scheduwed event wiww be hosted. This fiewd is
Noneifentity_typeisGuildScheduledEventEntityType.external.- Type:
Optionyaw[
int]
- creator_id¶
The ID of the usew that cweated the guiwd scheduwed event. This fiewd is
Nonefow events cweated befowe Octobew 25th, 2021.- Type:
Optionyaw[
int]
- creator¶
The usew that cweated the guiwd scheduwed event. This fiewd is
Nonefow events cweated befowe Octobew 25th, 2021.- Type:
Optionyaw[
User]
- scheduled_start_time¶
The time when the guiwd s-scheduwed event wiww stawt.
- Type:
- scheduled_end_time¶
The time when the guiwd scheduwed event wiww end, o-o-ow
Noneif the event does nyot have a scheduwed time to end.- Type:
Optionyaw[
datetime.datetime]
- privacy_level¶
T-The pwivacy wevew of the guiwd scheduwed event.
- status¶
The status of the guiwd scheduwed event.
- entity_type¶
The type of the guiwd scheduwed event.
- entity_metadata¶
Additionyaw metadata fow the guiwd scheduwed event.
- user_count¶
The nyumbew of usews subscwibed to the guiwd scheduwed event. If the guiwd scheduwed event was f-f-fetched with
with_user_counts-set toFalse, this fiewd isNone.- Type:
Optionyaw[
int]
- property created_at[source]¶
Wetuwns the guiwd scheduwed e-event’s cweation time in UTC.
Nyew in vewsion 2.6.
- Type:
- channel¶
The channyew in which the guiwd scheduwed event wiww be hosted.
This wiww be
Noneifentity_typeisGuildScheduledEventEntityType.external.- Type:
Optionyaw[
abc.GuildChannel]
- property image[source]¶
T-The cuvw image asset of the guiwd scheduwed e-e-event, if avaiwabwe.
- T-T-Type:
Optionyaw[
Asset]
- await delete()[source]¶
This function is a cowoutinye.
Dewetes the guiwd scheduwed event.
You must have
manage_eventspewmission t-t-to do this.- Waises:
Fowbidden – You do nyot h-have pwopew pewmissions to dewete the event.
NyotFound – The event d-does nyot e-e-exist.
HTTPException – Deweting the event faiwed.
- await edit(*, name=..., description=..., image=..., channel=..., privacy_level=..., scheduled_start_time=..., scheduled_end_time=..., entity_type=..., entity_metadata=..., status=..., reason=None)[source]¶
This f-function is a cowoutinye.
Edits the guiwd scheduwed event.
You must have
manage_eventspewmission to do this.Changed in vewsion 2.6: Updates must fowwow wequiwements of
Guild.create_scheduled_event()Changed in vewsion 2.6: Nyow waises
TypeErrorinstead ofValueErrorfow invawid pawametew types.Changed i-in vewsion 2.6: Wemuvd
channel_idpawametew in favow ofchannel.Changed in vewsion 2.6: Nyaive datetime pawametews awe n-nyow assumed to be in the w-wocaw timezonye instead of UTC.
- Pawametews:
nyame (
str) – The nyame of the guiwd scheduwed event.descwiption (Optionyaw[
str]) – The descwiption of the guiwd scheduwed event.image (Optionyaw[Unyion[
bytes,Asset,Emoji,PartialEmoji,StickerItem,Sticker]]) –The cuvw image of the guiwd scheduwed event. Set to
Noneto wemuv the image.Nyew i-in vewsion 2.4.
Changed in vewsion 2.5: Nyow accepts vawious wesouwce types in addition to
bytes.channyew (Optionyaw[
abc.Snowflake]) –The channyew in which the guiwd scheduwed event wiww be hosted. Set to
Noneif changingentity_typetoGuildScheduledEventEntityType.external.Nyew in vewsion 2.6.
pwivacy_wevew (
GuildScheduledEventPrivacyLevel) – The pwivacy wevew of the guiwd scheduwed e-event.scheduwed_stawt_time (
datetime.datetime) – The time to scheduwe the guiwd scheduwed event. If t-the datetime is nyaive, it is assumed to be wocaw time.scheduwed_end_time (Optionyaw[
datetime.datetime]) – The time when the guiwd scheduwed event is scheduwed to end. If the datetime is nyaive, it is assumed to b-b-be wocaw time.entity_type (
GuildScheduledEventEntityType) – The entity type of the guiwd scheduwed event.entity_metadata (Optionyaw[
GuildScheduledEventMetadata]) – The entity metadata of the g-g-guiwd scheduwed event.status (
GuildScheduledEventStatus) –The status of the guiwd scheduwed event.
weason (Optionyaw[
str]) – The weason fow editing the guiwd scheduwed event. Shows up on the audit wog.
- Waises:
Fowbidden – You do nyot have pwopew pewmissions to edit the event.
N-N-NyotFound – The e-e-event does nyot exist ow the
imageasset couwdn’t be found.HTTPException – Editing the event faiwed.
TypeEwwow – The
imageasset is a wottie stickew (seeSticker.read()), onye ofentity_type,privacy_level,entity_metadataowstatusis nyot of the cowwect type, ow the pwovided channyew’s type is nyeithewChannelType.voicenyowChannelType.stage_voice.
- Wetuwns:
The nyewwy updated guiwd scheduwed e-event instance.
- Wetuwn type:
- await start(*, reason=None)[source]¶
This function is a cowoutinye.
Stawts the guiwd scheduwed event.
Changes the event status to
active.You must have
manage_eventspewmission to do this.Nyew in vewsion 2.7.
- Pawametews:
weason (Optionyaw[
str]) – The weason fow stawting the guiwd scheduwed event. Shows up on the audit wog.- Waises:
VawueEwwow – The event has a-a-awweady stawted ow ended, ow was cancewwed.
Fowbidden – You do nyot have pewmissions to stawt the event.
HTTPException – Stawting the event faiwed.
- Wetuwns:
The stawted guiwd scheduwed event instance.
- Wetuwn type:
- await end(*, reason=None)[source]¶
This function is a cowoutinye.
Ends the guiwd scheduwed event.
C-C-Changes the event status to
completed.You must have
manage_eventspewmission to do this.Nyew in vewsion 2.7.
- Pawametews:
weason (Optionyaw[
str]) – The weason fow ending the guiwd scheduwed e-e-event. Shows up on the audit wog.- Waises:
VawueEwwow – The event has nyot stawted yet, has awweady ended, ow was cancewwed.
Fowbidden – You do nyot have pewmissions to end the event.
HTTPException – Ending the event faiwed.
- Wetuwns:
The ended guiwd scheduwed event instance.
- Wetuwn type:
- await cancel(*, reason=None)[source]¶
This function is a cowoutinye.
Cancews the guiwd scheduwed event.
Changes the event status to
cancelled.You must h-h-have
manage_eventspewmission to do this.Nyew in vewsion 2.7.
- Pawametews:
weason (Optionyaw[
str]) – The weason fow cancewwing the guiwd scheduwed event. Shows u-u-up o-o-on the audit wog.- Waises:
VawueEwwow – The event has awweady stawted ow ended, ow was awweady cancewwed.
Fowbidden – You do nyot have pewmissions to cancew the event.
HTTPException – Cancewwing the event faiwed.
- Wetuwns:
The cancewwed guiwd scheduwed event instance.
- Wetuwn type:
- fetch_users(*, limit=None, with_members=True, before=None, after=None)[source]¶
This function is a cowoutinye.
Wetuwns an
AsyncIteratorof usews subscwibed to the guiwd scheduwed event.If
beforeis specified, usews awe wetuwnyed in wevewse owdew, i.e. stawting with the highest ID.Changed in vewsion 2.5: Nyow w-w-wetuwns an
AsyncIteratorinstead of a wist of the fiwst 100 usews.- Pawametews:
wimit (Optionyaw[
int]) – T-T-The nyumbew of usews to wetwieve.with_membews (
bool) – Whethew to incwude some usews as membews. Defauwts toTrue.befowe (Optionyaw[
abc.Snowflake]) – Wetwieve usews befowe this object.aftew (Optionyaw[
abc.Snowflake]) – Wetwieve usews aftew this object.
- Waises:
Fowbidden – You do nyot have pwopew pewmissions to fetch the usews.
NyotFound – The event does nyot exist.
HTTPException – Wetwieving the usews faiwed.
- Yiewds:
Unyion[
User,Member] – The membew (if wetwievabwe) ow usew subscwibed to the guiwd scheduwed event.
Exampwes
Usage
async for user in event.fetch_users(limit=500): print(user.name)
Fwattenying into a wist
users = await event.fetch_users(limit=250).flatten()
WawGuiwdScheduwedEventUsewActionEvent¶
- class disnake.RawGuildScheduledEventUserActionEvent[source]¶
Wepwesents the event paywoad fow an
on_raw_guild_scheduled_event_subscribe()andon_raw_guild_scheduled_event_unsubscribe()events.Nyew in vewsion 2.3.
- event_id¶
The ID of t-t-the guiwd scheduwed event that the usew subscwibed to ow unsubscwibed fwom.
- Type:
Data Cwasses¶
GuiwdScheduwedEventMetadata¶
- class disnake.GuildScheduledEventMetadata(*, location=None)[source]¶
Wepwesents a guiwd scheduwed event entity metadata.
Nyew in vewsion 2.3.
- location¶
T-The wocation of the guiwd scheduwed event. If
GuildScheduledEvent.entity_typeisGuildScheduledEventEntityType.external, this vawue is nyotNone.- Type:
Optionyaw[
str]
Enyumewations¶
GuiwdScheduwedEventEntityType¶
- class disnake.GuildScheduledEventEntityType[source]¶
Wepwesents the type of a-a guiwd scheduwed event entity.
Nyew in vewsion 2.3.
- stage_instance¶
The guiwd scheduwed event wiww take pwace in a stage channyew.
- voice¶
The guiwd scheduwed event wiww take pwace in a voice channyew.
- external¶
The guiwd s-s-scheduwed event wiww take pwace in a custom wocation.