From 8433b6bc700ba89796ed02a92c86ee92e65276a9 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Fri, 9 Aug 2024 13:30:29 +0800 Subject: [PATCH] fix hyp_vote for 3.8 f-string --- plugins/{hypvote.py => hyp_vote.py} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename plugins/{hypvote.py => hyp_vote.py} (94%) diff --git a/plugins/hypvote.py b/plugins/hyp_vote.py similarity index 94% rename from plugins/hypvote.py rename to plugins/hyp_vote.py index 73fbbe6..aa40662 100644 --- a/plugins/hypvote.py +++ b/plugins/hyp_vote.py @@ -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()