hikari.scheduled_events#

Application and entities that are used to describe guild scheduled events on Discord.

Module Contents#

class hikari.scheduled_events.EventPrivacyLevel[source]#

Bases: int, hikari.internal.enums.Enum

Enum of the possible scheduled event privacy levels.

GUILD_ONLY = 2[source]#

The scheduled event is only available to guild members.

class hikari.scheduled_events.ScheduledEvent[source]#

Bases: hikari.snowflakes.Unique

Base class for scheduled events.

property image_url: Optional[hikari.files.URL][source]#

Cover image for this scheduled event, if set.

app: hikari.traits.RESTAware[source]#

Client application that models may use for procedures.

creator: Optional[hikari.users.User][source]#

The user who created the scheduled event.

This will only be set for event created after 2021-10-25.

description: Optional[str][source]#

Description of the scheduled event.

end_time: Optional[datetime.datetime][source]#

When the event is scheduled to end, if set.

entity_type: ScheduledEventType[source]#

The type of entity this scheduled event is associated with.

guild_id: hikari.snowflakes.Snowflake[source]#

ID of the guild this scheduled event belongs to.

id: hikari.snowflakes.Snowflake[source]#

ID of the scheduled event.

image_hash: Optional[str][source]#

Hash of the image used for the scheduled event, if set.

name: str[source]#

Name of the scheduled event.

privacy_level: EventPrivacyLevel[source]#

Privacy level of the scheduled event.

This restricts who can view and join the scheduled event.

start_time: datetime.datetime[source]#

When the event is scheduled to start.

status: ScheduledEventStatus[source]#

Status of the scheduled event.

user_count: Optional[int][source]#

The number of users that have subscribed to the event.

This will be None on gateway events when creating and editing a scheduled event.

make_image_url(*, ext='png', size=4096)[source]#

Generate the cover image for this scheduled event, if set.

Parameters:
extstr

The extension to use for this URL, defaults to png. Supports png, jpeg, jpg and webp.

sizeint

The size to set for the URL, defaults to 4096. Can be any power of two between 16 and 4096.

Returns:
typing.Optional[hikari.files.URL]

The URL, or None if no cover image is set.

Raises:
ValueError

If size is not a power of two between 16 and 4096 (inclusive).

class hikari.scheduled_events.ScheduledEventStatus[source]#

Bases: int, hikari.internal.enums.Enum

Enum of the scheduled event statuses.

ACTIVE = 2[source]#

Indicates an eventis on-going.

CANCELED = 4[source]#

Indicates an event has been canceled.

CANCELLED[source]#

Alias of ScheduledEventStatus.CANCELED.

COMPLETED = 3[source]#

Indicates an event has finished.

SCHEDULED = 1[source]#

Indicates that the scheduled event hasn’t occurred yet.

class hikari.scheduled_events.ScheduledEventType[source]#

Bases: int, hikari.internal.enums.Enum

Enum of the scheduled event types.

EXTERNAL = 3[source]#

A scheduled event which takes part outside of Discord.

STAGE_INSTANCE = 1[source]#

A scheduled stage instance.

VOICE = 2[source]#

A scheculed voice chat event.

class hikari.scheduled_events.ScheduledEventUser[source]#

A user who is subscribed to a scheduled event.

event_id: hikari.snowflakes.Snowflake[source]#

ID of the scheduled event they’re subscribed to.

member: Optional[hikari.guilds.Member][source]#

Their guild member object if they’re in the event’s guild.

user: hikari.users.User[source]#

Object representing the user.

class hikari.scheduled_events.ScheduledExternalEvent[source]#

Bases: ScheduledEvent

A scheduled event that takes place outside of Discord.

end_time: datetime.datetime[source]#

When the event is scheduled to end.

location: str[source]#

The location of the scheduled event.

Note

There is no strict format for this field, and it will likely be a user friendly string.

class hikari.scheduled_events.ScheduledStageEvent[source]#

Bases: ScheduledEvent

A scheduled event that takes place in a stage channel.

channel_id: hikari.snowflakes.Snowflake[source]#

ID of the stage channel this event is scheduled in.

class hikari.scheduled_events.ScheduledVoiceEvent[source]#

Bases: ScheduledEvent

A scheduled event that takes place in a voice channel.

channel_id: hikari.snowflakes.Snowflake[source]#

ID of the voice channel this scheduled event is in.