🚑 加大mys自动签到和获取的延时,修复原神猜语音排行榜可能的问题

This commit is contained in:
CMHopeSunshine 2022-08-11 12:14:49 +08:00
parent 37127600b1
commit db2aee32a3
2 changed files with 8 additions and 4 deletions

View File

@ -321,7 +321,10 @@ class Guess:
num = 0 num = 0
msg = '本群猜语音排行榜:' msg = '本群猜语音排行榜:'
for user, data in user_list[:10]: for user, data in user_list[:10]:
user = await bot.get_group_member_info(group_id=event.group_id, user_id=user) try:
user = await bot.get_group_member_info(group_id=event.group_id, user_id=user)
except:
user = {'card': user, 'nickname': user}
num += 1 num += 1
msg += f"\n{num}名: {escape(user['card']) or escape(user['nickname'])}, 猜对{data['count']}" msg += f"\n{num}名: {escape(user['card']) or escape(user['nickname'])}, 猜对{data['count']}"
return msg return msg

View File

@ -659,7 +659,7 @@ async def auto_sign():
logger.info('---派蒙开始执行米游社自动签到---') logger.info('---派蒙开始执行米游社自动签到---')
sign_list = await get_sign_list() sign_list = await get_sign_list()
for user_id, uid, remind_id in data: for user_id, uid, remind_id in data:
await sleep(random.randint(3, 8)) await sleep(random.randint(20, 35))
sign_result = await sign(uid) sign_result = await sign(uid)
if not isinstance(sign_result, str): if not isinstance(sign_result, str):
await sleep(1) await sleep(1)
@ -687,7 +687,7 @@ async def auto_sign():
group_str += str(ann_list.index(u) + 1) + u + '\n' group_str += str(ann_list.index(u) + 1) + u + '\n'
try: try:
await get_bot().send_group_msg(group_id=group_id, message=group_str) await get_bot().send_group_msg(group_id=group_id, message=group_str)
await sleep(random.randint(3, 8)) await sleep(random.randint(5, 10))
except Exception as e: except Exception as e:
logger.error(f'米游社签到结果发送失败:{e}') logger.error(f'米游社签到结果发送失败:{e}')
@ -699,6 +699,7 @@ async def coin_auto_sign():
if data: if data:
logger.info('---派蒙开始执行米游币自动获取---') logger.info('---派蒙开始执行米游币自动获取---')
for user_id, uid, remind_id in data: for user_id, uid, remind_id in data:
await sleep(random.randint(20, 35))
sk = await get_private_stoken(uid, key='uid') sk = await get_private_stoken(uid, key='uid')
try: try:
stoken = sk[0][4] stoken = sk[0][4]
@ -791,7 +792,7 @@ async def check_note():
message=f'[CQ:at,qq={user_id}]⚠️你的树脂已经达到了{now_data["data"]["current_resin"]},记得清理哦!⚠️') message=f'[CQ:at,qq={user_id}]⚠️你的树脂已经达到了{now_data["data"]["current_resin"]},记得清理哦!⚠️')
except Exception as e: except Exception as e:
logger.error(f'---派蒙发送树脂提醒失败:{e}---') logger.error(f'---派蒙发送树脂提醒失败:{e}---')
await sleep(3) await sleep(random.randint(8, 15))
@scheduler.scheduled_job('cron', hour=0, misfire_grace_time=10) @scheduler.scheduled_job('cron', hour=0, misfire_grace_time=10)