sidequest_common.schemas.discord_events#
Two-way guild event <-> Discord scheduled event sync: the bot-facing contract.
The API decides what Discord should show (DiscordEventPush); the bot does every Discord call and reports back
what Discord actually holds (DiscordEventState). See sidequest_common.models.events.GuildEvent for the hash
columns that keep the two sides from echoing each other.
Attributes#
|
Classes#
|
|
One guild event whose Discord event is out of date. Fields are Discord-ready (within Discord's limits). |
|
|
|
What Discord currently holds for one scheduled event, as the bot read it (gateway payload or REST response). |
|
A Discord scheduled event's status, named the way Discord's |
|
|
|
|
|
|
|
One unposted sign-up activity row, queued to post as a forum comment on |
Module Contents#
- class sidequest_common.schemas.discord_events.ActivityAck#
Bases:
pydantic.BaseModelPOST /api/guilds/{guild_id}/event-sync/activity/ack: the bot posted these sign-up activity rows.- ids: list[uuid.UUID]#
- class sidequest_common.schemas.discord_events.DiscordEventPush#
Bases:
pydantic.BaseModelOne guild event whose Discord event is out of date. Fields are Discord-ready (within Discord’s limits).
- action: PushAction#
- description: str#
- discord_event_id: int | None#
- ends_at: datetime.datetime#
- event_id: uuid.UUID#
- location: str#
- name: str#
- push_hash: str#
- signup_url: str#
- starts_at: datetime.datetime#
- thread_id: int | None#
- title: str#
- class sidequest_common.schemas.discord_events.DiscordEventReconcile#
Bases:
pydantic.BaseModelPOST /api/guilds/{guild_id}/event-sync/reconcile: every scheduled event currently in the guild.Applied like individual updates, then any linked guild event whose event isn’t listed is treated as deleted in Discord, and any tombstone whose event isn’t listed is dropped.
- events: list[DiscordEventState]#
- class sidequest_common.schemas.discord_events.DiscordEventState#
Bases:
pydantic.BaseModelWhat Discord currently holds for one scheduled event, as the bot read it (gateway payload or REST response).
- channel_id: int | None#
- description: str | None = None#
- ends_at: datetime.datetime | None = None#
- id: int#
- location: str | None#
- name: str#
- starts_at: datetime.datetime#
- status: DiscordEventStatus#
- class sidequest_common.schemas.discord_events.DiscordEventStatus#
Bases:
enum.StrEnumA Discord scheduled event’s status, named the way Discord’s
EventStatusis.Initialize self. See help(type(self)) for accurate signature.
- ACTIVE = 'active'#
- CANCELLED = 'cancelled'#
- COMPLETED = 'completed'#
- SCHEDULED = 'scheduled'#
- class sidequest_common.schemas.discord_events.DiscordInterestReport#
Bases:
pydantic.BaseModelPUT /api/guilds/{guild_id}/event-sync/interest/{discord_event_id}: the full interested-user set now.Replaces the previously reported set for the guild event linked to
discord_event_id; a no-op (204) if no guild event is linked to it.- user_ids: list[int]#
- class sidequest_common.schemas.discord_events.DiscordPushAck#
Bases:
pydantic.BaseModelPOST /api/guilds/{guild_id}/event-sync/{event_id}/ack: the bot appliedpush_hash.eventis what Discord returned, orNonewhen no Discord event is linked any more (ended, deleted, or the push was skipped because the start time had passed).thread_idis the event’s forum thread, if any.- event: DiscordEventState | None#
- push_hash: str#
- thread_id: int | None = None#
- class sidequest_common.schemas.discord_events.DiscordSyncPending#
Bases:
pydantic.BaseModelGET /api/guilds/{guild_id}/event-sync: everything the bot should write to Discord now.- activity: list[SignupActivity]#
- deletions: list[int]#
- pushes: list[DiscordEventPush]#
- class sidequest_common.schemas.discord_events.SignupActivity#
Bases:
pydantic.BaseModelOne unposted sign-up activity row, queued to post as a forum comment on
thread_id.- action: str#
- comment: str | None = None#
- detail: str | None = None#
- discord_id: int | None#
- display_name: str#
- id: uuid.UUID#
- thread_id: int#
- sidequest_common.schemas.discord_events.PushAction#
upsert: create the event ifdiscord_event_idisNone(or it no longer exists), else edit it.cancel: cancel a scheduled event (end an active one).complete: end an active event, delete a scheduled one. Aftercancel/completethe bot acks withevent=None: the guild event is no longer linked.