From db2aee32a33715fc394f2b9d8a5b31d42884aa38 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Thu, 11 Aug 2022 12:14:49 +0800 Subject: [PATCH] =?UTF-8?q?:ambulance:=20=E5=8A=A0=E5=A4=A7mys=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=AD=BE=E5=88=B0=E5=92=8C=E8=8E=B7=E5=8F=96=E7=9A=84?= =?UTF-8?q?=E5=BB=B6=E6=97=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=8E=9F=E7=A5=9E?= =?UTF-8?q?=E7=8C=9C=E8=AF=AD=E9=9F=B3=E6=8E=92=E8=A1=8C=E6=A6=9C=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Guess_voice/handler.py | 5 ++++- Paimon_Info/__init__.py | 7 ++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Guess_voice/handler.py b/Guess_voice/handler.py index 26c5c9b..358f6b9 100644 --- a/Guess_voice/handler.py +++ b/Guess_voice/handler.py @@ -321,7 +321,10 @@ class Guess: num = 0 msg = '本群猜语音排行榜:' 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 msg += f"\n第{num}名: {escape(user['card']) or escape(user['nickname'])}, 猜对{data['count']}次" return msg diff --git a/Paimon_Info/__init__.py b/Paimon_Info/__init__.py index e48e7dc..4f7c16c 100644 --- a/Paimon_Info/__init__.py +++ b/Paimon_Info/__init__.py @@ -659,7 +659,7 @@ async def auto_sign(): logger.info('---派蒙开始执行米游社自动签到---') sign_list = await get_sign_list() 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) if not isinstance(sign_result, str): await sleep(1) @@ -687,7 +687,7 @@ async def auto_sign(): group_str += str(ann_list.index(u) + 1) + u + '\n' try: 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: logger.error(f'米游社签到结果发送失败:{e}') @@ -699,6 +699,7 @@ async def coin_auto_sign(): if data: logger.info('---派蒙开始执行米游币自动获取---') for user_id, uid, remind_id in data: + await sleep(random.randint(20, 35)) sk = await get_private_stoken(uid, key='uid') try: stoken = sk[0][4] @@ -791,7 +792,7 @@ async def check_note(): message=f'[CQ:at,qq={user_id}]⚠️你的树脂已经达到了{now_data["data"]["current_resin"]},记得清理哦!⚠️') except Exception as e: logger.error(f'---派蒙发送树脂提醒失败:{e}---') - await sleep(3) + await sleep(random.randint(8, 15)) @scheduler.scheduled_job('cron', hour=0, misfire_grace_time=10)