2021-07-09 15:31:30 +00:00
|
|
|
from pyrogram import Client
|
|
|
|
from pyrogram.types import Message
|
|
|
|
from defs.character import get_character, get_mz
|
|
|
|
|
|
|
|
|
|
|
|
async def character_msg(client: Client, message: Message):
|
|
|
|
name = message.text.replace('角色资料', '').replace('角色简介', '').replace('角色查询', '').strip()
|
2022-01-27 13:24:14 +00:00
|
|
|
text, url = await get_character(name)
|
2021-07-09 15:31:30 +00:00
|
|
|
if url:
|
|
|
|
await message.reply_photo(photo=url, caption=text, quote=True)
|
|
|
|
else:
|
|
|
|
await message.reply(text, quote=True)
|
|
|
|
|
|
|
|
|
|
|
|
async def mz_msg(client: Client, message: Message):
|
|
|
|
name = message.text.replace('命座', '')
|
|
|
|
text = await get_mz(name)
|
|
|
|
await message.reply(text, quote=True)
|