Skip to content

hikari.scheduled_events#

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

EventPrivacyLevel #

Bases: int, Enum

Enum of the possible scheduled event privacy levels.

GUILD_ONLY class-attribute instance-attribute #

GUILD_ONLY = 2

The scheduled event is only available to guild members.

ScheduledEvent #

Bases: Unique

Base class for scheduled events.

app class-attribute instance-attribute #

app: RESTAware = attrs.field(
    repr=False,
    eq=False,
    hash=False,
    metadata={attrs_extensions.SKIP_DEEP_COPY: True},
)

Client application that models may use for procedures.

creator class-attribute instance-attribute #

creator: User | None = attrs.field(hash=False, repr=False)

The user who created the scheduled event.

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

description class-attribute instance-attribute #

description: str | None = attrs.field(
    hash=False, repr=False
)

Description of the scheduled event.

end_time class-attribute instance-attribute #

end_time: datetime | None = attrs.field(
    hash=False, repr=False
)

When the event is scheduled to end, if set.

entity_type class-attribute instance-attribute #

entity_type: ScheduledEventType = attrs.field(
    hash=False, repr=True
)

The type of entity this scheduled event is associated with.

guild_id class-attribute instance-attribute #

guild_id: Snowflake = attrs.field(hash=False, repr=True)

ID of the guild this scheduled event belongs to.

id class-attribute instance-attribute #

id: Snowflake = attrs.field(hash=True, repr=True)

ID of the scheduled event.

image_hash class-attribute instance-attribute #

image_hash: str | None = attrs.field(hash=False, repr=False)

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

name class-attribute instance-attribute #

name: str = attrs.field(hash=False, repr=True)

Name of the scheduled event.

privacy_level class-attribute instance-attribute #

privacy_level: EventPrivacyLevel = attrs.field(
    hash=False, repr=False
)

Privacy level of the scheduled event.

This restricts who can view and join the scheduled event.

recurrence_rule class-attribute instance-attribute #

recurrence_rule: ScheduledEventRecurrenceRule | None = (
    attrs.field(hash=False, repr=False)
)

The definition for how often this event should recur, if set.

start_time class-attribute instance-attribute #

start_time: datetime = attrs.field(hash=False, repr=False)

When the event is scheduled to start.

status class-attribute instance-attribute #

status: ScheduledEventStatus = attrs.field(
    hash=False, repr=True
)

Status of the scheduled event.

user_count class-attribute instance-attribute #

user_count: int | None = attrs.field(hash=False, repr=False)

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 #

make_image_url(
    *,
    file_format: Literal[
        "PNG", "JPEG", "JPG", "WEBP"
    ] = "PNG",
    size: int = 4096,
    lossless: bool = True,
) -> URL | None

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

If no cover image is set, this returns None.

PARAMETER DESCRIPTION
file_format

The format to use for this URL.

Supports PNG, JPEG, JPG, and WEBP.

If not specified, the format will be PNG.

TYPE: Literal['PNG', 'JPEG', 'JPG', 'WEBP'] DEFAULT: 'PNG'

size

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

TYPE: int DEFAULT: 4096

lossless

Whether to return a lossless or compressed WEBP image; This is ignored if file_format is not WEBP.

TYPE: bool DEFAULT: True

RETURNS DESCRIPTION
Optional[URL]

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

RAISES DESCRIPTION
TypeError

If an invalid format is passed for file_format.

ValueError

If size is specified but is not a power of two or not between 16 and 4096.

ScheduledEventRecurrenceFrequency #

Bases: int, Enum

Enum of how often a scheduled event recurs.

DAILY class-attribute instance-attribute #

DAILY = 3

The event recurs daily.

MONTHLY class-attribute instance-attribute #

MONTHLY = 1

The event recurs monthly.

WEEKLY class-attribute instance-attribute #

WEEKLY = 2

The event recurs weekly.

YEARLY class-attribute instance-attribute #

YEARLY = 0

The event recurs yearly.

ScheduledEventRecurrenceMonth #

Bases: int, Enum

Enum of the months a scheduled event can recur on.

APRIL class-attribute instance-attribute #

APRIL = 4

AUGUST class-attribute instance-attribute #

AUGUST = 8

DECEMBER class-attribute instance-attribute #

DECEMBER = 12

FEBRUARY class-attribute instance-attribute #

FEBRUARY = 2

JANUARY class-attribute instance-attribute #

JANUARY = 1

JULY class-attribute instance-attribute #

JULY = 7

JUNE class-attribute instance-attribute #

JUNE = 6

MARCH class-attribute instance-attribute #

MARCH = 3

MAY class-attribute instance-attribute #

MAY = 5

NOVEMBER class-attribute instance-attribute #

NOVEMBER = 11

OCTOBER class-attribute instance-attribute #

OCTOBER = 10

SEPTEMBER class-attribute instance-attribute #

SEPTEMBER = 9

ScheduledEventRecurrenceNWeekday #

A specific day within a specific week for a scheduled event to recur on.

day class-attribute instance-attribute #

The day within the week to recur on.

n class-attribute instance-attribute #

n: int = attrs.field(repr=True)

The week within the month to recur on, between 1 and 5.

ScheduledEventRecurrenceRule #

The definition for how often a scheduled event should recur.

This is a subset of the behaviours defined in the iCalendar RFC and is subject to several limitations on which field combinations are valid, which are documented here.

by_month class-attribute instance-attribute #

by_month: (
    Sequence[ScheduledEventRecurrenceMonth | int] | None
) = attrs.field(default=None, repr=False)

The specific months to recur on, if set.

by_month_day class-attribute instance-attribute #

by_month_day: Sequence[int] | None = attrs.field(
    default=None, repr=False
)

The specific dates within a month to recur on (1-31), if set.

by_n_weekday class-attribute instance-attribute #

by_n_weekday: (
    Sequence[ScheduledEventRecurrenceNWeekday] | None
) = attrs.field(default=None, repr=False)

The specific days within specific weeks for the event to recur on, if set.

by_weekday class-attribute instance-attribute #

by_weekday: (
    Sequence[ScheduledEventRecurrenceWeekday | int] | None
) = attrs.field(default=None, repr=False)

The specific days within a week for the event to recur on, if set.

by_year_day class-attribute instance-attribute #

by_year_day: Sequence[int] | None = attrs.field(
    default=None, repr=False
)

The specific days within a year to recur on (1-364), if set.

Note

This cannot be set when creating or editing a scheduled event and will be ignored there.

count class-attribute instance-attribute #

count: int | None = attrs.field(default=None, repr=False)

The total amount of times the event is allowed to recur before stopping, if set.

Note

This cannot be set when creating or editing a scheduled event and will be ignored there.

end class-attribute instance-attribute #

end: datetime | None = attrs.field(default=None, repr=False)

The ending time of the recurrence interval, if set.

Note

This cannot be set when creating or editing a scheduled event and will be ignored there.

frequency class-attribute instance-attribute #

frequency: ScheduledEventRecurrenceFrequency | int = (
    attrs.field(repr=True)
)

How often the event occurs.

interval class-attribute instance-attribute #

interval: int = attrs.field(default=1, repr=True)

The spacing between events, defined by frequency.

For example, a frequency of hikari.scheduled_events.ScheduledEventRecurrenceFrequency.WEEKLY and an interval of 2 would be "every-other week".

start class-attribute instance-attribute #

start: datetime = attrs.field(repr=True)

The starting time of the recurrence interval.

ScheduledEventRecurrenceWeekday #

Bases: int, Enum

Enum of the weekdays a scheduled event can recur on.

FRIDAY class-attribute instance-attribute #

FRIDAY = 4

MONDAY class-attribute instance-attribute #

MONDAY = 0

SATURDAY class-attribute instance-attribute #

SATURDAY = 5

SUNDAY class-attribute instance-attribute #

SUNDAY = 6

THURSDAY class-attribute instance-attribute #

THURSDAY = 3

TUESDAY class-attribute instance-attribute #

TUESDAY = 1

WEDNESDAY class-attribute instance-attribute #

WEDNESDAY = 2

ScheduledEventStatus #

Bases: int, Enum

Enum of the scheduled event statuses.

ACTIVE class-attribute instance-attribute #

ACTIVE = 2

Indicates an event is on-going.

CANCELED class-attribute instance-attribute #

CANCELED = 4

Indicates an event has been canceled.

CANCELLED class-attribute instance-attribute #

CANCELLED = CANCELED

COMPLETED class-attribute instance-attribute #

COMPLETED = 3

Indicates an event has finished.

SCHEDULED class-attribute instance-attribute #

SCHEDULED = 1

Indicates that the scheduled event hasn't occurred yet.

ScheduledEventType #

Bases: int, Enum

Enum of the scheduled event types.

EXTERNAL class-attribute instance-attribute #

EXTERNAL = 3

A scheduled event which takes part outside of Discord.

STAGE_INSTANCE class-attribute instance-attribute #

STAGE_INSTANCE = 1

A scheduled stage instance.

VOICE class-attribute instance-attribute #

VOICE = 2

A scheduled voice chat event.

ScheduledEventUser #

A user who is subscribed to a scheduled event.

event_id class-attribute instance-attribute #

event_id: Snowflake = attrs.field(hash=False, repr=True)

ID of the scheduled event they're subscribed to.

member class-attribute instance-attribute #

member: Member | None = attrs.field(hash=False, repr=False)

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

user class-attribute instance-attribute #

user: User = attrs.field(hash=True, repr=True)

Object representing the user.

ScheduledExternalEvent #

Bases: ScheduledEvent

A scheduled event that takes place outside of Discord.

end_time class-attribute instance-attribute #

end_time: datetime = attrs.field(hash=False, repr=False)

When the event is scheduled to end.

location class-attribute instance-attribute #

location: str = attrs.field(hash=False, repr=False)

The location of the scheduled event.

Note

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

ScheduledStageEvent #

Bases: ScheduledEvent

A scheduled event that takes place in a stage channel.

channel_id class-attribute instance-attribute #

channel_id: Snowflake = attrs.field(hash=False, repr=False)

ID of the stage channel this event is scheduled in.

ScheduledVoiceEvent #

Bases: ScheduledEvent

A scheduled event that takes place in a voice channel.

channel_id class-attribute instance-attribute #

channel_id: Snowflake = attrs.field(hash=False, repr=False)

ID of the voice channel this scheduled event is in.