Lawnmower/plugins/find.py
2022-04-30 22:47:55 +08:00

23 lines
790 B
Python

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"关键词 <b>{' '.join(message.command[1:])}</b> 搜索到了:\n"
for i in data:
text += f" - <code>{i.uid}</code> - <b>{i.name}</b>\n"
await message.reply_text(text)
else:
await message.reply_text("此关键词没有搜索到结果。")