groups#
Group voice channel schemas: the bot’s session reports, and the officer stats and public leaderboard.
Discord snowflakes are strings on the wire (browsers can’t hold them in a JS number).
- sidequest_common.schemas.groups.GROUP_KINDS: tuple[EventKind, ...]#
The kinds the
#lfgpanel offers, in button order.socialis the panel’s “Hangout”.
- sidequest_common.schemas.groups.GROUP_KIND_PREFIX: dict[EventKind, str]#
dungeon-1by default,dungeon-deadminesonce named.- Type:
Channel name prefix
- sidequest_common.schemas.groups.GROUP_KIND_DEFAULT_CAP: dict[EventKind, int | None]#
Voice user limit a new channel gets;
Noneis no limit. The owner can change it.
- sidequest_common.schemas.groups.MAX_GROUP_CAP = 99#
Discord’s voice channel user limit ceiling.
- sidequest_common.schemas.groups.MAX_LIVE_GROUPS = 15#
Group channels allowed at once across the server.
- sidequest_common.schemas.groups.EMPTY_GRACE_SECONDS = 120#
How long a group channel may sit empty (or unjoined after creation) before it is torn down.
- sidequest_common.schemas.groups.COUNTED_GROUP_MINUTES = 10#
A session counts toward stats once two or more members spent this many minutes in it together.
- sidequest_common.schemas.groups.GROUP_TRANSCRIPT_RETENTION_DAYS = 30#
- sidequest_common.schemas.groups.PARTY_ANIMAL_THRESHOLD = 50#
Counted groups a member must take part in (10+ minutes each) for the Party Animal badge.
- sidequest_common.schemas.groups.PARTY_LEADER_THRESHOLD = 25#
Counted groups a member must start for the Party Leader badge.
- sidequest_common.schemas.groups.CROSSROADS_HOST_THRESHOLD = 10#
Counted PUG groups a member must start for the Crossroads Host badge (the first one earns Open Road).
- sidequest_common.schemas.groups.CARAVAN_MASTER_THRESHOLD = 25#
Counted PUG groups a member must start for the Caravan Master badge.
- sidequest_common.schemas.groups.MAX_GROUP_NAME_LENGTH = 80#
- sidequest_common.schemas.groups.MAX_GROUP_NOTE_LENGTH = 200#
- sidequest_common.schemas.groups.MAX_TRANSCRIPT_MESSAGES = 2000#
- class sidequest_common.schemas.groups.GroupEndReason[source]#
Bases:
enum.StrEnumWhy a group channel was torn down.
- EMPTY = 'empty'#
Everyone left and it stayed empty for
EMPTY_GRACE_SECONDS.
- UNJOINED = 'unjoined'#
Nobody joined within
EMPTY_GRACE_SECONDSof creation.
- OWNER = 'owner'#
The owner pressed End.
- LOST = 'lost'#
The channel disappeared (deleted by hand, or gone when the bot came back up).
- class sidequest_common.schemas.groups.GroupMemberMinutes[source]#
Bases:
pydantic.BaseModelOne member’s cumulative minutes in a group channel, so far.
- discord_id: str#
- display_name: str#
- minutes: int#
- class sidequest_common.schemas.groups.GroupPairMinutes[source]#
Bases:
pydantic.BaseModelCumulative minutes two members spent in a group channel together.
discord_id_a < discord_id_b.- discord_id_a: str#
- discord_id_b: str#
- minutes: int#
- class sidequest_common.schemas.groups.GroupPresenceReport[source]#
Bases:
pydantic.BaseModelBot -> API: a group channel’s cumulative presence so far.
Idempotent like
VoicePresenceReport: every number is stored asmax(existing, reported), so the bot can push repeatedly, including after a restart resumed its counters fromGroupSessionSchema.- peak_size: int#
- grouped_minutes: int#
- pug_minutes: int#
Minutes with at least one guild member and one outside player (PUG role holder) present together.
- members: list[GroupMemberMinutes]#
- pairs: list[GroupPairMinutes]#
- class sidequest_common.schemas.groups.GroupSessionCreate[source]#
Bases:
pydantic.BaseModelBody for
POST /api/guilds/{id}/groups: the bot just created a group channel.- discord_channel_id: str#
- channel_name: str#
- creator_discord_id: str#
- name: str | None#
- note: str | None#
- needs: list[SignupRole]#
- cap: int | None#
- event_id: uuid.UUID | None = None#
- card_message_id: str | None = None#
- pug_role_id: str | None = None#
the temporary Discord role its invite grants to outside players.
- Type:
Set for a PUG group
- class sidequest_common.schemas.groups.GroupSessionUpdate[source]#
Bases:
pydantic.BaseModelBody for
PATCH /api/guilds/{id}/groups/{session_id}. Only fields sent change; sendnullto clear.- channel_name: str | None#
nullleaves it as is.- Type:
Never cleared
- name: str | None#
- note: str | None#
- needs: list[SignupRole] | None = None#
- cap: int | None#
- owner_discord_id: str | None = None#
- card_message_id: str | None = None#
- class sidequest_common.schemas.groups.GroupTranscriptMessage[source]#
Bases:
pydantic.BaseModelOne message from a group channel’s text chat.
- author_discord_id: str#
- author_name: str#
- content: str#
- created_at: datetime.datetime#
- attachments: list[str]#
Attachment URLs. Discord’s CDN links expire, so these are a pointer, not a copy.
- class sidequest_common.schemas.groups.GroupSessionClose[source]#
Bases:
pydantic.BaseModelBody for
POST /api/guilds/{id}/groups/{session_id}/close. Closing twice keeps the first close.- end_reason: GroupEndReason#
- presence: GroupPresenceReport#
- transcript: list[GroupTranscriptMessage]#
- class sidequest_common.schemas.groups.GroupSessionSchema[source]#
Bases:
pydantic.BaseModelA group session as the bot sees it: settings plus presence so far, so a restarted bot can resume counting.
- id: uuid.UUID#
- discord_channel_id: str#
- channel_name: str#
- name: str | None#
- note: str | None#
- needs: list[SignupRole]#
- cap: int | None#
- creator_discord_id: str#
- owner_discord_id: str#
- event_id: uuid.UUID | None#
- card_message_id: str | None#
- pug_role_id: str | None = None#
- started_at: datetime.datetime#
- ended_at: datetime.datetime | None#
- end_reason: GroupEndReason | None#
- peak_size: int#
- grouped_minutes: int#
- pug_minutes: int = 0#
- members: list[GroupMemberMinutes]#
- pairs: list[GroupPairMinutes]#
- class sidequest_common.schemas.groups.GroupTranscriptPurge[source]#
Bases:
pydantic.BaseModelReply from
POST /api/guilds/{id}/groups/purge: transcripts deleted for being past retention.- deleted: int#
- class sidequest_common.schemas.groups.GroupPerson[source]#
Bases:
pydantic.BaseModelSomeone on a stats list.
member_idis set when they have a site account (links to their profile).- discord_id: str#
- display_name: str#
- member_id: int | None = None#
- class sidequest_common.schemas.groups.GroupPersonStat[source]#
Bases:
pydantic.BaseModelOne person’s line on a stats list:
valueis minutes, groups, or partners depending on the list.- person: GroupPerson#
- value: int#
- sessions: int#
- class sidequest_common.schemas.groups.GroupDuoStat[source]#
Bases:
pydantic.BaseModelTwo people who grouped together.
- a: GroupPerson#
- b: GroupPerson#
- minutes: int#
- sessions: int#
- class sidequest_common.schemas.groups.GroupKindStat[source]#
Bases:
pydantic.BaseModelCounted sessions and member-minutes for one kind.
- sessions: int#
- minutes: int#
- class sidequest_common.schemas.groups.GroupInstanceStat[source]#
Bases:
pydantic.BaseModelHow often a named group (an instance, usually) was run.
- name: str#
- sessions: int#
- class sidequest_common.schemas.groups.GroupHourStat[source]#
Bases:
pydantic.BaseModelCounted sessions that started in one weekday/hour slot, America/Chicago.
weekday0 is Monday.- weekday: int#
- hour: int#
- sessions: int#
- class sidequest_common.schemas.groups.GroupStats[source]#
Bases:
pydantic.BaseModelGET /api/groups/stats(officer): who groups, with whom, and what, over the lastdaysdays.Only counted sessions (see
COUNTED_GROUP_MINUTES) feed the lists;sessions_totalincludes the rest. Lists hold at most ten lines each.- days: int#
- sessions_total: int#
- sessions_counted: int#
- grouped_minutes: int#
- by_kind: list[GroupKindStat]#
- top_instances: list[GroupInstanceStat]#
- most_grouped: list[GroupPersonStat]#
- most_social: list[GroupPersonStat]#
- best_duos: list[GroupDuoStat]#
- most_led: list[GroupPersonStat]#
- busy_hours: list[GroupHourStat]#
- class sidequest_common.schemas.groups.GroupSessionSummary[source]#
Bases:
pydantic.BaseModelOne line on
GET /api/groups/sessions(officer).- id: uuid.UUID#
- name: str | None#
- channel_name: str#
- creator: GroupPerson#
- event_id: uuid.UUID | None#
- started_at: datetime.datetime#
- ended_at: datetime.datetime | None#
- end_reason: GroupEndReason | None#
- peak_size: int#
- grouped_minutes: int#
- counted: bool#
- has_transcript: bool#
- class sidequest_common.schemas.groups.GroupSessionDetail[source]#
Bases:
GroupSessionSummaryGET /api/groups/sessions/{id}(officer): one session with who was in it and its chat, if still kept.- note: str | None#
- needs: list[SignupRole]#
- members: list[GroupPersonStat]#
- transcript: list[GroupTranscriptMessage] | None#
- transcript_expires_at: datetime.datetime | None#
- class sidequest_common.schemas.groups.GroupLeaderboardRow[source]#
Bases:
pydantic.BaseModelOne line on the public “most grouped” board. Only members with a site account appear.
- member_id: int#
- display_name: str#
- groups: int#
- minutes: int#
- class sidequest_common.schemas.groups.GroupLeaderboard[source]#
Bases:
pydantic.BaseModelGET /api/groups/leaderboard(public): members by counted groups joined, last 30 days and all time.- month: list[GroupLeaderboardRow]#
- all_time: list[GroupLeaderboardRow]#