diff --git a/ci.py b/ci.py index 6374ba7..ac5b288 100644 --- a/ci.py +++ b/ci.py @@ -1,7 +1,7 @@ from configparser import RawConfigParser from pyrogram import Client from apscheduler.schedulers.asyncio import AsyncIOScheduler -from httpx import AsyncClient +from httpx import AsyncClient, get # 读取配置文件 config = RawConfigParser() config.read("config.ini") @@ -15,6 +15,7 @@ headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" } client = AsyncClient(timeout=10.0, headers=headers) +me = get(f"https://api.telegram.org/bot{bot_token}/getme").json() # 初始化客户端 scheduler = AsyncIOScheduler() if not scheduler.running: diff --git a/plugins/process.py b/plugins/process.py index 7146e84..c5f04bf 100644 --- a/plugins/process.py +++ b/plugins/process.py @@ -6,6 +6,7 @@ from pyrogram import Client, emoji from pyrogram.types import Message, InlineQuery, CallbackQuery from pyrogram import filters as Filters +from ci import me from plugins.enemies import enemies_msg from plugins.mys2 import mys2_msg, mys2_qun_msg from plugins.start import welcome_command, ping_command, help_command, leave_command, help_callback @@ -118,7 +119,7 @@ async def process_group_msg(client: Client, message: Message): text = message.text msg_list = text.split(' ') # 帮助消息 - if msg_list[0] == '/help': + if msg_list[0] == '/help' or msg_list[0] == f'/help@{me["result"]["username"]}': await help_command(client, message) # # 武器查询 if text.startswith('武器查询') or text.startswith('武器资料'):