mirror of
https://github.com/KimigaiiWuyi/GenshinUID.git
synced 2025-05-31 04:30:29 +08:00
新增:每日自动米游币任务结束后向SUPERUSER
发送报告
This commit is contained in:
parent
d454fe5bfe
commit
99820423c3
@ -494,7 +494,9 @@ async def daily_mihoyo_bbs_sign():
|
||||
cursor = c.execute(
|
||||
'SELECT * FROM NewCookiesTable WHERE StatusC != ?', ('off',))
|
||||
c_data = cursor.fetchall()
|
||||
logger.info(c_data)
|
||||
im_success = 0
|
||||
im_failed = 0
|
||||
im_failed_str = ''
|
||||
for row in c_data:
|
||||
logger.info('正在执行{}'.format(row[0]))
|
||||
if row[8]:
|
||||
@ -502,10 +504,18 @@ async def daily_mihoyo_bbs_sign():
|
||||
im = await mihoyo_coin(str(row[2]), str(row[8]))
|
||||
try:
|
||||
logger.info('已执行完毕:{}'.format(row[0]))
|
||||
im_success += 1
|
||||
if await config_check('MhyBBSCoinReport'):
|
||||
await hoshino_bot.send_private_msg(user_id=row[2], message=im)
|
||||
except Exception:
|
||||
logger.exception('执行失败:{}'.format(row[0]))
|
||||
im_failed += 1
|
||||
im_failed_str += '\n' + '执行失败:{}'.format(row[0])
|
||||
faild_im = '\n以下为签到失败报告:{}'.format(im_failed_str) if im_failed_str != '' else ''
|
||||
im = '今日获取mhycoin成功数量:{},失败数量:{}{}'.format(im_success, im_failed, faild_im)
|
||||
for qid in bot.config.SUPERUSERS:
|
||||
await hoshino_bot.send_private_msg(user_id = qid, message = im)
|
||||
await asyncio.sleep(5 + random.randint(1, 3))
|
||||
logger.info('已结束。')
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user