from pyrogram import Client, filters
from pyrogram.types import Message
from defs.find import find
from ci import me
@Client.on_message(filters.incoming &
filters.command(["find", f"find@{me.username}"]))
async def find_thing(_: Client, message: Message):
if len(message.command) == 1:
await message.reply_text(
"❌ 请指定要查找的内容"
)
else:
data = find(message.command[1:])
if data:
text = f"关键词 {' '.join(message.command[1:])} 搜索到了:\n"
for i in data:
text += f" - {i.uid}
- {i.name}\n"
await message.reply_text(text)
else:
await message.reply_text("此关键词没有搜索到结果。")