补充草主信息,增加指令删除ck

This commit is contained in:
CMHopeSunshine 2022-08-26 19:38:24 +08:00
parent 670bbdd5d4
commit 5cd172f3d6
2 changed files with 35 additions and 8 deletions

View File

@ -402,6 +402,15 @@
"元素充能效率": 1 "元素充能效率": 1
} }
}, },
"草主": {
"常规": {
"暴击率": 1,
"暴击伤害": 1,
"攻击力": 1,
"元素充能效率": 1,
"元素精通": 1
}
},
"荒泷一斗": { "荒泷一斗": {
"常规": { "常规": {
"暴击率": 1, "暴击率": 1,
@ -739,6 +748,10 @@
1, 1,
0 0
], ],
"草主": [
1,
0
],
"云堇": [ "云堇": [
2, 2,
1 1

View File

@ -39,24 +39,30 @@ ysbc = on_command('ysbc', aliases={'查询ck', '查询绑定', '绑定信息', '
'pm_usage': 'ysbc', 'pm_usage': 'ysbc',
'pm_priority': 2 'pm_priority': 2
}) })
delete_ck = on_command('删除ck', aliases={'删除cookie'}, priority=1, block=True, state={
'pm_name': '删除ck',
'pm_description': '删除你qq下绑定的所有cookie和订阅信息',
'pm_usage': '删除ck',
'pm_priority': 3
})
ysbca = on_command('校验所有ck', aliases={'校验所有cookie', '校验所有绑定'}, priority=1, block=True, permission=SUPERUSER, state={ ysbca = on_command('校验所有ck', aliases={'校验所有cookie', '校验所有绑定'}, priority=1, block=True, permission=SUPERUSER, state={
'pm_name': '校验所有ck', 'pm_name': '校验所有ck',
'pm_description': '校验所有cookie情况仅超级管理员可用', 'pm_description': '校验所有cookie情况仅超级管理员可用',
'pm_usage': '校验所有ck', 'pm_usage': '校验所有ck',
'pm_priority': 3 'pm_priority': 4
}) })
pck = on_command('添加公共cookie', aliases={'添加pck', '添加公共ck', 'add_pck'}, permission=SUPERUSER, block=True, priority=1, pck = on_command('添加公共cookie', aliases={'添加pck', '添加公共ck', 'add_pck'}, permission=SUPERUSER, block=True, priority=1,
state={ state={
'pm_name': '添加公共ck', 'pm_name': '添加公共ck',
'pm_description': '添加公共cookie仅超级管理员可用', 'pm_description': '添加公共cookie仅超级管理员可用',
'pm_usage': '添加公共ck[cookie]', 'pm_usage': '添加公共ck[cookie]',
'pm_priority': 4 'pm_priority': 5
}) })
clear = on_command('清除无效用户', permission=SUPERUSER, block=True, priority=1, state={ clear = on_command('清除无效用户', permission=SUPERUSER, block=True, priority=1, state={
'pm_name': '清除无效用户', 'pm_name': '清除无效用户',
'pm_description': '清除所有已退群或已删好友的用户的cookie、订阅等信息仅超级管理员可用', 'pm_description': '清除所有已退群或已删好友的用户的cookie、订阅等信息仅超级管理员可用',
'pm_usage': '清除无效用户', 'pm_usage': '清除无效用户',
'pm_priority': 5 'pm_priority': 6
}) })
@ -128,6 +134,14 @@ async def _(event: MessageEvent):
await ysbc.finish(f'{event.sender.card or event.sender.nickname}当前无绑定信息', at_sender=True) await ysbc.finish(f'{event.sender.card or event.sender.nickname}当前无绑定信息', at_sender=True)
@delete_ck.handle()
async def _(event: MessageEvent):
await PrivateCookie.filter(user_id=str(event.user_id)).delete()
await DailyNoteSub.filter(user_id=event.user_id).delete()
await MihoyoBBSSub.filter(user_id=event.user_id).delete()
await delete_ck.finish('已清除你号下绑定的ck和订阅信息', at_sender=True)
@ysbca.handle() @ysbca.handle()
async def _(event: MessageEvent): async def _(event: MessageEvent):
logger.info('原神Cookie', '开始校验所有cookie情况') logger.info('原神Cookie', '开始校验所有cookie情况')
@ -207,11 +221,11 @@ async def _(bot: Bot, event: MessageEvent):
for chara in all_character: for chara in all_character:
if int(chara.user_id) not in total_user_list: if int(chara.user_id) not in total_user_list:
await chara.delete() await chara.delete()
# 删除通用订阅信息 # # 删除通用订阅信息
all_sub = await GeneralSub.all() # all_sub = await GeneralSub.all()
for s in all_sub: # for s in all_sub:
if int(s.sub_id) not in total_user_list: # if int(s.sub_id) not in total_user_list:
await s.delete() # await s.delete()
# 删除原神树脂提醒信息 # 删除原神树脂提醒信息
all_note = await DailyNoteSub.all() all_note = await DailyNoteSub.all()
for n in all_note: for n in all_note: