mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-21 21:18:05 +00:00
jupai 举牌小人
This commit is contained in:
parent
3a94b216ca
commit
d7648a23c1
5
jupai/DES.md
Normal file
5
jupai/DES.md
Normal file
@ -0,0 +1,5 @@
|
||||
# 举牌小人
|
||||
|
||||
```
|
||||
,jupai 123
|
||||
```
|
28
jupai/main.py
Normal file
28
jupai/main.py
Normal file
@ -0,0 +1,28 @@
|
||||
import urllib.parse
|
||||
|
||||
from pagermaid.listener import listener
|
||||
from pagermaid.enums import Message
|
||||
from pagermaid.utils import lang
|
||||
|
||||
ju_pai_api = "https://juapi.org/api/zt.php"
|
||||
|
||||
|
||||
@listener(
|
||||
command="jupai",
|
||||
description="生成举牌小人",
|
||||
parameters="[text/reply]"
|
||||
)
|
||||
async def ju_pai(message: Message):
|
||||
text = message.obtain_message()
|
||||
if not text:
|
||||
return await message.edit(lang('arg_error'))
|
||||
try:
|
||||
image_url = f"{ju_pai_api}?msg={urllib.parse.quote(text)}"
|
||||
await message.reply_photo(
|
||||
image_url,
|
||||
quote=False,
|
||||
reply_to_message_id=message.reply_to_message_id or message.reply_to_top_message_id,
|
||||
)
|
||||
await message.safe_delete()
|
||||
except Exception as e:
|
||||
await message.edit(f"获取失败 ~ {e.__class__.__name__}")
|
Loading…
Reference in New Issue
Block a user