新增原神扫码绑定绑定CK,需要安装依赖poetry install

This commit is contained in:
CMHopeSunshine 2022-12-22 23:26:31 +08:00
parent 266b57ea16
commit 89f6b15d1f

View File

@ -1,5 +1,6 @@
# main code from lulu: https://github.com/lulu666lulu # main code from lulu: https://github.com/lulu666lulu
import asyncio import asyncio
import contextlib
import datetime import datetime
import json import json
import random import random
@ -22,8 +23,8 @@ from LittlePaimon.utils.api import get_bind_game_info
from LittlePaimon.utils.message import fullmatch_rule from LittlePaimon.utils.message import fullmatch_rule
CN_DS_SALT = 'JwYDpKvLj6MrMqqYU6jTKF17KNO2PXoS' CN_DS_SALT = 'JwYDpKvLj6MrMqqYU6jTKF17KNO2PXoS'
bind_tips = '绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定 uid]\n2.通过Cookie绑定获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定' bind_tips = '绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定]\n2.通过Cookie绑定获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定'
bind_tips_web = '绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定 uid]\n2.通过Cookie绑定获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定或前往{cookie_web_url}网页添加绑定' bind_tips_web = '绑定方法二选一:\n1.通过米游社扫码绑定:\n请发送指令[原神扫码绑定]\n2.通过Cookie绑定获取教程\ndocs.qq.com/doc/DQ3JLWk1vQVllZ2Z1\n获取后,使用[ysb cookie]指令绑定或前往{cookie_web_url}网页添加绑定'
running_login_data = {} running_login_data = {}
@ -139,7 +140,7 @@ async def _(event: MessageEvent): # sourcery skip: use-fstring-for-concatenatio
@scheduler.scheduled_job('cron', second='*/10', misfire_grace_time=10) @scheduler.scheduled_job('cron', second='*/10', misfire_grace_time=10)
async def check_qrcode(): async def check_qrcode():
try: with contextlib.suppress(RuntimeError):
for user_id, data in running_login_data.items(): for user_id, data in running_login_data.items():
send_msg = None send_msg = None
status_data = await check_login(data) status_data = await check_login(data)
@ -189,5 +190,3 @@ async def check_qrcode():
if not running_login_data: if not running_login_data:
break break
await asyncio.sleep(1) await asyncio.sleep(1)
except RuntimeError:
pass