Add presence heartbeat to keep bot shown as online
Adds a background asyncio.Task that calls set_presence("online") every
60 seconds to keep the homeserver presence status fresh. On startup the
bot sets itself online and spawns the heartbeat; on shutdown the task is
cancelled and presence is set to offline before closing the client.
https://claude.ai/code/session_01Nu3N2okrfJV3meatEmYdrB
This commit is contained in:
@@ -47,6 +47,9 @@ class DealsBot:
|
||||
else:
|
||||
self._first_run_done = True
|
||||
|
||||
# Start presence heartbeat so the bot shows as "online"
|
||||
await self.matrix.start_presence_heartbeat()
|
||||
|
||||
async def stop(self):
|
||||
"""Clean shutdown."""
|
||||
await self._http.aclose()
|
||||
|
||||
Reference in New Issue
Block a user