- Fixed a bug where a string literal "sleep" was passed to the delay function.
- Switched from blocking time.sleep() to non-blocking await asyncio.sleep() to ensure the bot remains responsive during large purge operations.
- The delay now correctly pulls the numerical value from self.config["sleep"].
fix: resolve room aliases in setpower and filter unjoined space rooms
This commit addresses two issues that caused API errors during room iteration and power level syncing:
1. Filter unjoined rooms in `get_space_roomlist`:
Previously, the bot assumed it was a member of all child rooms returned by the parent space state. If the bot was missing from certain child rooms, it threw errors during subsequent operations. The room list is now intersected with `await self.client.get_joined_rooms()` to safely ignore rooms the bot hasn't actually joined yet. Logging has been added to indicate when rooms are skipped.
2. Fix alias resolution (Sigil Bug) in `room_setpower`:
The `room_setpower <target_room>` command failed when users provided a standard room alias (starting with `#`) instead of an internal room ID (`!`), as the Matrix API expects the internal ID for state event operations. Added logic to detect aliases and explicitly resolve them to their respective `room_id` via `self.client.resolve_room_alias()` before attempting to update power levels. Appropriate error handling was also added to notify the user if the alias cannot be resolved.
The insert or update logic would not work with postgresql. The new
implementation is database agnostic, so long as the response is still
the same on sqllite
good for shutting off temporary rooms and keeping your space tidy, and
migrating to new rooms that the bot has appropriate permissions for.
probably doesn't solve every problem but should make it a little easier
to fix permission issues and such.