diff --git a/plugin/LeisurePlugin/__init__.py b/plugin/LeisurePlugin/__init__.py index deb80e8..143f306 100644 --- a/plugin/LeisurePlugin/__init__.py +++ b/plugin/LeisurePlugin/__init__.py @@ -1,5 +1,5 @@ from plugin.LeisurePlugin.leisure import * -from plugin.LeisurePlugin.tarot import TarotCards,TarotCard +from plugin.LeisurePlugin.tarot import TarotCards, TarotCard import os if not os.path.exists("./database/LeisurePlugin"): @@ -11,16 +11,27 @@ cx = sqlite3.connect("./database/LeisurePlugin/leisure.sqlite") cursor = cx.cursor() cursor.execute('create table IF NOT EXISTS userinfo(' - 'id integer primary key,' - 'userid integer UNIQUE,' - 'score integer default 0,' - 'lastsignin varchar(50),' + 'id integer primary key,' + 'userid integer UNIQUE,' + 'score integer default 0,' + 'lastsignin varchar(50),' 'keepsigndays integer not null default 1' - ')') + ')') + +cursor.execute('drop table if exists tarot') + cursor.execute('create table IF NOT EXISTS tarot (' 'id integer primary key,' 'cardsid integer,' 'cardname varchar(40) not null,' - 'position int not null default 1 )') + 'cardexpress TEXT not null)') + +cursor.execute("create table if not exists playerdrawcard(" + "id integer primary key," + "userid integer not null," + "drawtime varchar(50) not null," + "cardid integer not null," + "cardposition integer not null" + ")") cx.commit() cx.close() diff --git a/plugin/LeisurePlugin/leisure.py b/plugin/LeisurePlugin/leisure.py index 41d79b3..76b4731 100644 --- a/plugin/LeisurePlugin/leisure.py +++ b/plugin/LeisurePlugin/leisure.py @@ -28,10 +28,10 @@ def signup(userid: int) -> tuple: if differ == 1: singinmsg += f"{user[0][0] + 1},你已连续签到{user[0][2] + 1}天\n这是你今天的塔罗牌" cursor.execute( - f"update userinfo set lastsignin = '{today}',score = {user[0][0] + 1},keepsigndays = {user[0][2]+1} where userid = {userid}") + f"update userinfo set lastsignin = '{today}',score = score + 1,keepsigndays = keepsigndays + 1 where userid = {userid}") else: singinmsg += f"{user[0][0] + 1},连续签到中断惹~\n这是你今天的塔罗牌" - cursor.execute(f"update userinfo set lastsignin = '{today}',score = {user[0][0] + 1},keepsigndays = 1 where userid = {userid}") + cursor.execute(f"update userinfo set lastsignin = '{today}',score = score + 1 ,keepsigndays = 1 where userid = {userid}") cx.commit() else: return False, "一天只能签到一次哦~" diff --git a/plugin/MajSoulInfo/__init__.py b/plugin/MajSoulInfo/__init__.py index fac7692..ce4a7ad 100644 --- a/plugin/MajSoulInfo/__init__.py +++ b/plugin/MajSoulInfo/__init__.py @@ -48,6 +48,13 @@ "drawcount int," "lastdraw varchar(50)" ")") +cursor.execute("create table if not exists playerdrawcard(" + "id integer primary key," + "userid integer not null," + "drawtime varchar(50) not null," + "itemlevel int not null," + "itemname TEXT not null" + ")") cursor.execute("create view if not exists groupwatches as " "select groupid," "group_concat(playername) as watchedplayers,"