Replace str.removeprefix

to avoid having to bump Python version to 3.9
This commit is contained in:
Andrew Ferrazzutti 2021-06-18 00:38:45 -04:00
parent 2fec597cba
commit c124b4c49e

View File

@ -100,4 +100,5 @@ class Message:
async def delete_all_noid_msgs(cls, room_id: RoomID) -> None: async def delete_all_noid_msgs(cls, room_id: RoomID) -> None:
status = await cls.db.execute("DELETE FROM message " status = await cls.db.execute("DELETE FROM message "
"WHERE mid IS NULL AND mx_room=$1", room_id) "WHERE mid IS NULL AND mx_room=$1", room_id)
return int(status.removeprefix("DELETE ")) # Skip leading "DELETE "
return int(status[7:])