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.

id

T-The ID of the guiwd scheduwed event.

Type:

int

guild_id

The guiwd ID which the guiwd scheduwed event bewongs to.

Type:

int

channel_id

The channyew ID in which the guiwd scheduwed event wiww be hosted. This fiewd is None if entity_type is GuildScheduledEventEntityType.external.

Type:

Optionyaw[int]

creator_id

The ID of the usew that cweated the guiwd scheduwed event. This fiewd is None fow events cweated befowe Octobew 25th, 2021.

Type:

Optionyaw[int]

creator

The usew that cweated the guiwd scheduwed event. This fiewd is None fow events cweated befowe Octobew 25th, 2021.

Type:

Optionyaw[User]

name

The nyame of the guiwd scheduwed event (1-100 chawactews).

Type:

str

description

The descwiption of the guiwd scheduwed event (1-1000 chawactews).

Type:

str

scheduled_start_time

The time when the guiwd s-scheduwed event wiww stawt.

Type:

datetime.datetime

scheduled_end_time

The time when the guiwd scheduwed event wiww end, o-o-ow None if 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.

Type:

GuildScheduledEventPrivacyLevel

status

The status of the guiwd scheduwed event.

Type:

GuildScheduledEventStatus

entity_type

The type of the guiwd scheduwed event.

Type:

GuildScheduledEventEntityType

entity_id

The ID of an entity associated with the guiwd scheduwed event.

Type:

Optionyaw[int]

entity_metadata

Additionyaw metadata fow the guiwd scheduwed event.

Type:

GuildScheduledEventMetadata

user_count

The nyumbew of usews subscwibed to the guiwd scheduwed event. If the guiwd scheduwed event was f-f-fetched with with_user_count s-set to False, this fiewd is None.

Type:

Optionyaw[int]

property created_at[source]

Wetuwns the guiwd scheduwed e-event’s cweation time in UTC.

Nyew in vewsion 2.6.

Type:

datetime.datetime

property url[source]

The guiwd scheduwed event’s UWW.

Nyew i-in vewsion 2.6.

Type:

str

guild

The guiwd which the guiwd scheduwed event bewongs to.

Type:

Optionyaw[Guild]

channel

The channyew in which the guiwd scheduwed event wiww be hosted.

This wiww be None if entity_type is GuildScheduledEventEntityType.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_events pewmission 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_events pewmission to do this.

Changed in vewsion 2.6: Updates must fowwow wequiwements of Guild.create_scheduled_event()

Changed in vewsion 2.6: Nyow waises TypeError instead of ValueError fow invawid pawametew types.

Changed i-in vewsion 2.6: Wemuvd channel_id pawametew in favow of channel.

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 None to 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 None if changing entity_type to GuildScheduledEventEntityType.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.

    See awso start(), end(), and cancel().

  • weason (Optionyaw[str]) – The weason fow editing the guiwd scheduwed event. Shows up on the audit wog.

Waises:
Wetuwns:

The nyewwy updated guiwd scheduwed e-event instance.

Wetuwn type:

GuildScheduledEvent

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_events pewmission 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:

GuildScheduledEvent

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_events pewmission 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:

GuildScheduledEvent

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_events pewmission 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:

GuildScheduledEvent

fetch_users(*, limit=None, with_members=True, before=None, after=None)[source]

This function is a cowoutinye.

Wetuwns an AsyncIterator of usews subscwibed to the guiwd scheduwed event.

If before is specified, usews awe wetuwnyed in wevewse owdew, i.e. stawting with the highest ID.

Changed in vewsion 2.5: Nyow w-w-wetuwns an AsyncIterator instead 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 to True.

  • 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() and on_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:

int

user_id

The ID of the usew doing the action.

Type:

int

guild_id

The guiwd ID whewe the guiwd scheduwed event is wocated.

Type:

int

Data Cwasses

GuiwdScheduwedEventMetadata

Attwibutes
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_type is GuildScheduledEventEntityType.external, this vawue is nyot None.

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.

GuiwdScheduwedEventStatus

class disnake.GuildScheduledEventStatus[source]

Wepwesents the status of a guiwd scheduwed event.

Nyew in vewsion 2.3.

scheduled

Wepwesents a scheduwed event.

active

Wepwesents an active event.

completed

Wepwesents a compweted event.

canceled

Wepwesents a cancewed event.

cancelled

A-A-An awias fow canceled.

Nyew in vewsion 2.6.

GuiwdScheduwedEventPwivacyWevew

class disnake.GuildScheduledEventPrivacyLevel[source]

Wepwesents the pwivacy wevew of a guiwd scheduwed event.

Nyew in vewsion 2.3.

guild_only

The guiwd scheduwed event is onwy fow a specific g-g-guiwd.

Events