diff --git a/botmodule/command/test.py b/botmodule/command/test.py index ccc7dccb619dbaeb07f05d9074e05a9409295c99..abc592d70d626cd963fac503423dd70efa84287f 100644 --- a/botmodule/command/test.py +++ b/botmodule/command/test.py @@ -36,6 +36,11 @@ def select_core_slave(coreindex: str, botmsg: Message, putinfo: dict): masterid = putinfo.get('master', {}).get('id', 1) slavename = putinfo.get('slave', {}).get('comment', '未知') if coreindex == 1: + if config.nospeed: + msgtext = f"/relay {masterid} edit {edit_chat_id} {edit_msg_id} ❌此后端禁止测速服务" + botmsg.edit_text(msgtext) + logger.info("由于此后端禁止测速服务,已取消任务") + return None return SpeedCore(botmsg.chat.id, botmsg.id, SPEEDTESTIKM, (sp, (botmsg, 1, masterid, edit_chat_id, edit_msg_id, slavename))) elif coreindex == 2: @@ -276,6 +281,8 @@ async def process_slave(app: Client, message: Message, putinfo: dict, **kwargs): proxyinfo = putinfo.pop('proxies', []) kwargs.update(putinfo) core = select_core_slave(coreindex, message, putinfo) + if core is None: + return info = await core.core(proxyinfo, **kwargs) print("后端结果:", info) diff --git a/botmodule/init_bot.py b/botmodule/init_bot.py index 2ccba6c2c4cee8780a3e93c5e8b41f754cce1bb9..f683d362d7c4395d28f84f02e5a44fa9bb0f04a4 100644 --- a/botmodule/init_bot.py +++ b/botmodule/init_bot.py @@ -76,7 +76,7 @@ api_hash = botconfig.get('api_hash', None) bot_token = botconfig.get('bot_token', None) clash_path = config.get_clash_path() # 为clash核心运行路径, Windows系统需要加后缀名.exe clash_work_path = config.get_clash_work_path() # clash工作路径 -corenum = min(config.config.get('clash', {}).get('core', 1), 64) +corenum = min(config.config.get('clash', {}).get('core', 1), 127) admin = config.getAdmin() # 管理员 config.add_user(admin) config.reload() diff --git a/utils/bot.py b/utils/bot.py index b8039b7bdff3e11863fbce460c755a94ef9bc95b..fff3499d824237b2a7b7edd89687dba7690e5fde 100644 --- a/utils/bot.py +++ b/utils/bot.py @@ -294,7 +294,7 @@ def callback_loader(app: Client): # logger.info(str(test_items)) if message: sort_str = botmodule.get_sort_str(message) - slaveid = botmodule.get_slave_id(message.chat.id, message.id) + slaveid = botmodule.get_slave_id(message) await asyncio.sleep(2) await message.delete() await bot_put(client, origin_message, test_type, test_items, sort=sort_str, coreindex=3, slaveid=slaveid) diff --git a/utils/check.py b/utils/check.py index f08191c21f5fc8184714f5f873cc2fe78d5b5fd7..493f4c80cd6b4e6c07629cbf47d305e661010312 100644 --- a/utils/check.py +++ b/utils/check.py @@ -136,7 +136,7 @@ async def check_subowner(message, back_message, subinfo: dict, admin: list, pass except AttributeError: ID = message.sender_chat.id if not subinfo: - await back_message.edit_text("❌找不到该任务名称,请检查参数是否正确 (TEST DELETE MESSAGE)") + await back_message.edit_text("❌找不到该任务名称,请检查参数是否正确。") message_delete_queue.put_nowait([back_message.chat.id, back_message.id, 10]) # await back_message.delete() return False