From 49036b3df0ad2b2fadf1e76f18c66d3f8ae815ec Mon Sep 17 00:00:00 2001 From: Dan Trickey Date: Thu, 12 Dec 2024 19:11:41 +0000 Subject: [PATCH] Emergency Updates --- kmibot/api.py | 1 + kmibot/modules/pub/__init__.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/kmibot/api.py b/kmibot/api.py index a059fcf..5870d9d 100644 --- a/kmibot/api.py +++ b/kmibot/api.py @@ -97,6 +97,7 @@ class PubEventSchema(BaseModel): discord_id: int | None table: PubTableSchema | None attendees: list[PersonLinkWithDiscordSchema] + announcements: list[str] class FerryAPI: diff --git a/kmibot/modules/pub/__init__.py b/kmibot/modules/pub/__init__.py index 3e86086..797b1e9 100644 --- a/kmibot/modules/pub/__init__.py +++ b/kmibot/modules/pub/__init__.py @@ -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