From 9a494fc870b700c9b94c18eb8c57fbf5d98c6ef6 Mon Sep 17 00:00:00 2001 From: baby20162016 <2185823427@qq.com> Date: Fri, 2 Jan 2026 19:11:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D/jrcd=20@=E5=85=A8=E4=BD=93?= =?UTF-8?q?=E6=88=90=E5=91=98=20=E5=91=BD=E4=BB=A4=E4=BC=9A=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E6=8A=A5=E9=94=99=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/jrcd.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/jrcd.py b/plugins/jrcd.py index ee82e7f..d4df757 100644 --- a/plugins/jrcd.py +++ b/plugins/jrcd.py @@ -3,6 +3,7 @@ 提供 /jrcd 和 /bbcd 指令,用于娱乐。 """ + import random from datetime import datetime @@ -100,8 +101,13 @@ async def handle_bbcd(bot: Bot, event: MessageEvent, args: list[str]): print(message) if len(message) < 2: return + user_id1 = event.user_id - user_id2 = int(message[1].data.get("qq", 0)) + try: + user_id2 = int(message[1].data.get("qq", 0)) + except Exception: + return + if user_id1 == user_id2: await event.reply("不能和自己比!") return