Merge pull request #167 from SCUOP/nonebot2

Update __init__.py
This commit is contained in:
惜月 2022-08-10 23:12:37 -05:00 committed by GitHub
commit 6d41c4a043
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -700,6 +700,7 @@ async def coin_auto_sign():
logger.info('---派蒙开始执行米游币自动获取---') logger.info('---派蒙开始执行米游币自动获取---')
for user_id, uid, remind_id in data: for user_id, uid, remind_id in data:
sk = await get_private_stoken(uid, key='uid') sk = await get_private_stoken(uid, key='uid')
try:
stoken = sk[0][4] stoken = sk[0][4]
get_coin_task = MihoyoBBSCoin(stoken, user_id, uid) get_coin_task = MihoyoBBSCoin(stoken, user_id, uid)
data = await get_coin_task.run() data = await get_coin_task.run()
@ -707,7 +708,7 @@ async def coin_auto_sign():
await delete_coin_auto_sign(user_id, uid) await delete_coin_auto_sign(user_id, uid)
if remind_id.startswith('q'): if remind_id.startswith('q'):
await get_bot().send_private_msg(user_id=remind_id[1:], await get_bot().send_private_msg(user_id=remind_id[1:],
message=f'你的uid{uid}米游币获取失败,请重新绑定cookie再开启') message=f'你的uid{uid}米游币获取失败,请重新绑定stoken再开启')
else: else:
ann[remind_id]['失败'].append(f'.UID{uid}') ann[remind_id]['失败'].append(f'.UID{uid}')
else: else:
@ -716,6 +717,12 @@ async def coin_auto_sign():
message=f'你的uid{uid}米游币自动获取成功') message=f'你的uid{uid}米游币自动获取成功')
else: else:
ann[remind_id]['成功'].append(f'.UID{uid}') ann[remind_id]['成功'].append(f'.UID{uid}')
except:
await delete_coin_auto_sign(user_id, uid)
if remind_id.startswith('q'):
await get_bot().send_private_msg(user_id=remind_id[1:],
message=f'你的uid{uid}米游币获取失败请重新绑定stoken再开启')
logger.info('该成员未绑定stoken 获取失败, 已删除自动获取任务')
for group_id, content in ann.items(): for group_id, content in ann.items():
group_str = '米游币自动获取结果:\n' group_str = '米游币自动获取结果:\n'
for type, ann_list in content.items(): for type, ann_list in content.items():