2022-01-08 14:46:16 +00:00
|
|
|
from asyncio import sleep
|
2022-01-18 08:47:20 +00:00
|
|
|
from pagermaid import version
|
2020-08-24 08:04:52 +00:00
|
|
|
from pagermaid.listener import listener
|
2022-01-20 08:42:23 +00:00
|
|
|
from pagermaid.utils import alias_command, client
|
2020-08-24 08:04:52 +00:00
|
|
|
|
2021-06-16 07:09:40 +00:00
|
|
|
|
|
|
|
@listener(is_plugin=True, outgoing=True, command=alias_command("diss"),
|
2020-08-24 08:04:52 +00:00
|
|
|
description="儒雅随和版祖安语录。")
|
|
|
|
async def diss(context):
|
|
|
|
await context.edit("获取中 . . .")
|
2021-06-16 07:09:40 +00:00
|
|
|
for _ in range(20): # 最多尝试20次
|
2022-02-25 13:15:49 +00:00
|
|
|
req = await client.get("https://api.yanyuwangluo.cn/zuan/api.php?level=min&from=tntcrafthim")
|
2020-08-24 09:19:31 +00:00
|
|
|
if req.status_code == 200:
|
|
|
|
res = req.text
|
2022-01-08 14:46:16 +00:00
|
|
|
return await context.edit(res, parse_mode='html', link_preview=False)
|
2020-08-24 09:19:31 +00:00
|
|
|
else:
|
|
|
|
continue
|
2022-01-08 14:46:16 +00:00
|
|
|
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器 。")
|
|
|
|
await sleep(2)
|
|
|
|
await context.delete()
|
2020-08-24 08:04:52 +00:00
|
|
|
|
2021-06-16 07:09:40 +00:00
|
|
|
|
|
|
|
@listener(is_plugin=True, outgoing=True, command=alias_command("biss"),
|
2020-08-24 08:04:52 +00:00
|
|
|
description="加带力度版祖安语录。")
|
|
|
|
async def biss(context):
|
|
|
|
await context.edit("获取中 . . .")
|
2021-06-16 07:09:40 +00:00
|
|
|
for _ in range(20): # 最多尝试20次
|
2022-02-25 13:15:49 +00:00
|
|
|
req = await client.get("https://api.yanyuwangluo.cn/zuan/api.php?from=tntcrafthim")
|
2020-08-24 09:19:31 +00:00
|
|
|
if req.status_code == 200:
|
|
|
|
res = req.text
|
2022-01-08 14:46:16 +00:00
|
|
|
return await context.edit(res, parse_mode='html', link_preview=False)
|
2020-08-24 09:19:31 +00:00
|
|
|
else:
|
|
|
|
continue
|
2022-01-08 14:46:16 +00:00
|
|
|
await context.edit("出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器 。")
|
|
|
|
await sleep(2)
|
|
|
|
await context.delete()
|