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
1 changed files with 2 additions and 1 deletions

View File

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