Compare commits

..

No commits in common. "30f7a420cc7195134f0a80a9ba5c08293595f140" and "0368b2f6e97e66936ea89f0537947f71574d10a5" have entirely different histories.

34
main.py
View File

@ -38,40 +38,6 @@ class MyPlugin(Star):
yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 你坚持了{time}s哦{a}.射出{V}ml,{b}!") yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())}, 你坚持了{time}s哦{a}.射出{V}ml,{b}!")
@filter.command("打打你的")
async def dajiao_other(self, event: AstrMessageEvent, message: str):
if isUserExist(event.get_sender_id()) != True:
insertUser(event.get_sender_id())
time = round(random.uniform(1, 600), 2)
V = round(random.uniform(0.01,100), 2)
a = time_long(time)
b = volume(V)
conn=pymysql.connect(host = '192.168.31.9' # 连接名称默认127.0.0.1
,user = 'saipo' # 用户名
,passwd='Grasste0403' # 密码
,port= 3306 # 端口默认为3306
,db='saipo' # 数据库名称
,charset='utf8' # 字符编码
)
sql = "SELECT openid FROM dajiaouser WHERE nameid = %s"
cur = conn.cursor()
cur.execute(sql, (message,))
user_name_dajiao = cur.fetchall()[0][0]
if user_name_dajiao is None:
cur.close()
conn.close()
yield event.plain_result(f"没有找到这个人哦!")
sql = "INSERT INTO dajiao (openid, timelong, volume) VALUES (%s, %s, %s)"
values = (user_name_dajiao,time,V)
cur.execute(sql,values)
conn.commit()
cur.close()
conn.close()
yield event.plain_result(f"Hello,{get_user_name(event.get_sender_id())},你帮助{get_user_name(user_name_dajiao)}进行了一次打胶, TA坚持了{time}s哦{a}.射出{V}ml,{b}!")
@filter.command("我的时长成就") @filter.command("我的时长成就")
async def timebeat(self, event: AstrMessageEvent): async def timebeat(self, event: AstrMessageEvent):