From 9006c815ad716fb719b418cddd045fe525fdd985 Mon Sep 17 00:00:00 2001 From: Ruler229 Date: Wed, 21 May 2025 20:09:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 注释掉等号部分 --- main.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 0cf6681..d0ab875 100644 --- a/main.py +++ b/main.py @@ -49,21 +49,22 @@ class MyPlugin(Star): ,db='saipo' # 数据库名称 ,charset='utf8' # 字符编码 ) - cur = conn.cursor() + //cur = conn.cursor() time=[];V=[];a=[];b=[] for i in range(0,10): time.append(round(random.uniform(1, 600), 2)) V.append(round(random.uniform(0.01,100), 2)) a.append(time_long(time)) b.append(volume(V)) - sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" - values = (user_name,time[i],V[i]) - cur.execute(sql,values) - conn.commit() - cur.close() - conn.close() - yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n哎呀,一点也打不出来了!") - + //sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" + //values = (user_name,time[i],V[i]) + //cur.execute(sql,values) + //conn.commit() + //cur.close() + //conn.close() + //yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n哎呀,一点也打不出来了!") + yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 一点也打不出来了!") + @filter.command("打打你的") async def dajiao_other(self, event: AstrMessageEvent, message: str): if isUserExist(event.get_sender_id()) != True: From a53af94e9ddd3f7f2f8e0b47d83e3f5a1b248048 Mon Sep 17 00:00:00 2001 From: Ruler229 Date: Wed, 21 May 2025 20:23:44 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20main.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index d0ab875..9ca11d1 100644 --- a/main.py +++ b/main.py @@ -49,21 +49,21 @@ class MyPlugin(Star): ,db='saipo' # 数据库名称 ,charset='utf8' # 字符编码 ) - //cur = conn.cursor() + #cur = conn.cursor() time=[];V=[];a=[];b=[] for i in range(0,10): time.append(round(random.uniform(1, 600), 2)) V.append(round(random.uniform(0.01,100), 2)) a.append(time_long(time)) b.append(volume(V)) - //sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" - //values = (user_name,time[i],V[i]) - //cur.execute(sql,values) - //conn.commit() - //cur.close() - //conn.close() - //yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n哎呀,一点也打不出来了!") - yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 一点也打不出来了!") + #sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)" + #values = (user_name,time[i],V[i]) + #cur.execute(sql,values) + #conn.commit() + #cur.close() + #conn.close() + #yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n第二次你坚持了{time[1]}s哦,{a[1]}.射出{V[1]}ml,{b[1]}!\n哎呀,一点也打不出来了!") + yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 第一次你坚持了{time[0]}s哦,{a[0]}.射出{V[0]}ml,{b[0]}!\n一点也打不出来了!") @filter.command("打打你的") async def dajiao_other(self, event: AstrMessageEvent, message: str):