fix hyp_vote for 3.8 f-string

This commit is contained in:
shenjack 2024-08-09 13:30:29 +08:00
parent edf0ae7e00
commit 8433b6bc70
Signed by: shenjack
GPG Key ID: 7B1134A979775551

View File

@ -17,7 +17,7 @@ def fmt_vote(room_id) -> str:
if room_id not in VOTE:
VOTE[room_id] = EMPTY_VOTE.copy()
return "|".join(
f"{x}{VOTE[room_id][x] if VOTE[room_id][x] else ""}" for x in VOTE[room_id]
f"{x}{VOTE[room_id][x] if VOTE[room_id][x] else ''}" for x in VOTE[room_id]
)
@ -39,7 +39,7 @@ def hypvote(msg: IcaNewMessage, client: IcaClient):
elif arg[0] == "unvote":
for x in arg[1:]:
if x.isdigit() and 0 <= int(x) < 24:
if msg.sender_id in VOTE[int(x) % 24]:
if msg.sender_id in VOTE[msg.room_id][int(x) % 24]:
VOTE[msg.room_id][int(x) % 24].remove(msg.sender_id)
elif arg[0] == "clear":
VOTE[msg.room_id] = EMPTY_VOTE.copy()