Hallucinatin bots...
This commit is contained in:
parent
c9cf3fa615
commit
22d079f079
1 changed files with 5 additions and 14 deletions
|
|
@ -428,20 +428,11 @@ async def main():
|
||||||
"access_token": client.api.token,
|
"access_token": client.api.token,
|
||||||
"device_id": client.device_id
|
"device_id": client.device_id
|
||||||
}, f)
|
}, f)
|
||||||
|
|
||||||
# Bootstrap Cross-Signing and Key Recovery using the environment variable
|
# Create a new Olm account if one wasn't loaded from the crypto store
|
||||||
recovery_key = os.getenv("MATRIX_RECOVERY_KEY")
|
if not client.crypto.account:
|
||||||
if recovery_key and client.crypto:
|
log.info("Creating new Olm account...")
|
||||||
try:
|
await client.crypto.create_account()
|
||||||
log.info("Verifying recovery key and bootstrapping cross-signing...")
|
|
||||||
await client.crypto.verify_recovery_key(recovery_key)
|
|
||||||
if not await client.crypto.has_cross_signing_keys():
|
|
||||||
await client.crypto.bootstrap_cross_signing(
|
|
||||||
auth_data={"password": MATRIX_BOT_PASSWORD}
|
|
||||||
)
|
|
||||||
log.info("Cross-signing and key recovery initialized successfully.")
|
|
||||||
except Exception as e:
|
|
||||||
log.error(f"Failed to initialize cross-signing/recovery: {e}")
|
|
||||||
|
|
||||||
# Register Event Handlers
|
# Register Event Handlers
|
||||||
client.add_event_handler(EventType.ROOM_MEMBER, on_invite)
|
client.add_event_handler(EventType.ROOM_MEMBER, on_invite)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue