Hallucinatin bots...
This commit is contained in:
parent
c9cf3fa615
commit
22d079f079
1 changed files with 5 additions and 14 deletions
|
|
@ -429,19 +429,10 @@ async def main():
|
|||
"device_id": client.device_id
|
||||
}, f)
|
||||
|
||||
# Bootstrap Cross-Signing and Key Recovery using the environment variable
|
||||
recovery_key = os.getenv("MATRIX_RECOVERY_KEY")
|
||||
if recovery_key and client.crypto:
|
||||
try:
|
||||
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}")
|
||||
# Create a new Olm account if one wasn't loaded from the crypto store
|
||||
if not client.crypto.account:
|
||||
log.info("Creating new Olm account...")
|
||||
await client.crypto.create_account()
|
||||
|
||||
# Register Event Handlers
|
||||
client.add_event_handler(EventType.ROOM_MEMBER, on_invite)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue