Skip to content

Commit

Permalink
Emergency Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
trickeydan committed Dec 12, 2024
1 parent eae7f01 commit 49036b3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions kmibot/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class PubEventSchema(BaseModel):
discord_id: int | None
table: PubTableSchema | None
attendees: list[PersonLinkWithDiscordSchema]
announcements: list[str]


class FerryAPI:
Expand Down
10 changes: 10 additions & 0 deletions kmibot/modules/pub/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ async def handle_pub_event_change(
view=get_pub_buttons_view(pub),
)

if pub_event.announcements:
header = [
"**📢 Pub Announcements 📢**",
"",
]
await self.pub_channel.send(
"\n".join(header + [f"* {a}" for a in pub_event.announcements]),
view=get_pub_buttons_view(pub),
)

if (
old_event.status is not EventStatus.completed
and new_event.status is EventStatus.completed
Expand Down

0 comments on commit 49036b3

Please sign in to comment.