summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorauric <auric@japegames.com>2026-02-21 12:53:37 -0600
committerauric <auric@japegames.com>2026-02-21 12:53:37 -0600
commit25f07f6cc4eefe96c08f21d9415b914c5739b52b (patch)
tree5e57af71db175a3b17a8cd908a342b3eebcd3093
parent0d706ae72ceefd74053ad6cb0900ecce6cf1f085 (diff)
ensure bot is up to date
-rwxr-xr-xclients/umbrella-bot/umbrella-bot.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/clients/umbrella-bot/umbrella-bot.py b/clients/umbrella-bot/umbrella-bot.py
index 001b94c..fed3bdb 100755
--- a/clients/umbrella-bot/umbrella-bot.py
+++ b/clients/umbrella-bot/umbrella-bot.py
@@ -239,7 +239,8 @@ class AttachSession:
"body": f"```\n{data.rstrip()}\n```",
"format": "org.matrix.custom.html",
"formatted_body": f"<pre><code>{data.rstrip()}</code></pre>",
- }
+ },
+ ignore_unverified_devices=True,
)
except asyncio.CancelledError:
pass
@@ -458,7 +459,8 @@ async def run_bot(config: dict):
# Load encryption keys
if client.should_upload_keys:
await client.keys_upload()
- await client.keys_query()
+ if client.should_query_keys:
+ await client.keys_query()
# Message callback
async def on_message(room: MatrixRoom, event: RoomMessageText):
@@ -488,7 +490,8 @@ async def run_bot(config: dict):
"body": reply,
"format": "org.matrix.custom.html",
"formatted_body": reply.replace("\n", "<br>"),
- }
+ },
+ ignore_unverified_devices=True,
)
client.add_event_callback(on_message, RoomMessageText)
@@ -508,17 +511,21 @@ async def run_bot(config: dict):
# Initial sync
await client.sync(timeout=10000)
- await client.keys_query()
+ if client.should_query_keys:
+ await client.keys_query()
+
+ await client.joined_members(room_id)
# Main sync loop
async def sync_loop():
while not stop_event.is_set():
resp = await client.sync(timeout=30000, full_state=False)
if isinstance(resp, SyncResponse):
- # Upload any new keys
if client.should_upload_keys:
await client.keys_upload()
-
+ if client.should_query_keys:
+ await client.keys_query()
+
sync_task = asyncio.create_task(sync_loop())
await stop_event.wait()