feat: guest_added / guest_removed event handlers

This commit is contained in:
Joseph Doherty
2026-04-26 15:46:09 -04:00
parent b8335895e1
commit a1b4e251c5
2 changed files with 114 additions and 0 deletions
+18
View File
@@ -29,6 +29,24 @@ def _apply_chat_created(conn: Connection, e: Event) -> None:
)
@on("guest_added")
def _apply_guest_added(conn: Connection, e: Event) -> None:
p = e.payload
conn.execute(
"UPDATE chats SET guest_bot_id = ? WHERE id = ?",
(p["guest_bot_id"], p["chat_id"]),
)
@on("guest_removed")
def _apply_guest_removed(conn: Connection, e: Event) -> None:
p = e.payload
conn.execute(
"UPDATE chats SET guest_bot_id = NULL WHERE id = ?",
(p["chat_id"],),
)
@on("container_created")
def _apply_container_created(conn: Connection, e: Event) -> None:
p = e.payload