PagerMaid_Plugins_Pyro/xjj/main.py

32 lines
1.2 KiB
Python
Raw Permalink Normal View History

2023-03-20 13:55:24 +00:00
from pagermaid.listener import listener
from pagermaid.enums import Message, AsyncClient
2024-02-05 08:09:47 +00:00
async def get_video_url(client: AsyncClient) -> str:
res = await client.get("https://tucdn.wpon.cn/api-girl/index.php?wpon=json", timeout=10.0)
data = res.json()
return "https:" + data["mp4"]
2023-07-01 12:18:58 +00:00
@listener(command="xjj", description="小姐姐视频")
2023-03-20 13:55:24 +00:00
async def xjj(message: Message, client: AsyncClient):
if message.chat and message.chat.id == -1001441461877:
# 用户群禁止使用此功能
await message.edit("本群禁止使用此功能。")
return
await message.edit("小姐姐视频生成中 . . .")
try:
2024-02-05 08:09:47 +00:00
url = await get_video_url(client)
try:
await message.reply_video(
url,
quote=False,
reply_to_message_id=message.reply_to_message_id,
message_thread_id=message.message_thread_id,
)
await message.safe_delete()
except Exception as e:
await message.edit(f"出错了呜呜呜 ~ {e.__class__.__name__}")
2023-03-20 13:55:24 +00:00
except Exception as e:
await message.edit(f"出错了呜呜呜 ~ {e.__class__.__name__}")