mirror of
https://github.com/TeamPGM/PagerMaid_Plugins.git
synced 2024-11-21 14:38:31 +00:00
shangliu 修复接口
This commit is contained in:
parent
d31e7ea42d
commit
c84edaf2ff
@ -252,10 +252,10 @@
|
||||
},
|
||||
{
|
||||
"name": "shangliu",
|
||||
"version": "1.011",
|
||||
"version": "1.02",
|
||||
"section": "chat",
|
||||
"maintainer": "TNTcraftHIM",
|
||||
"size": "2.5 kb",
|
||||
"size": "2.6 kb",
|
||||
"supported": true,
|
||||
"des-short": "上流对话工具",
|
||||
"des": "让你可以随时放彩虹屁,毒鸡汤,或者变身营销号(迫真,配合-tts食用更佳)。命令:chp,djt,yxh。"
|
||||
|
22
shangliu.py
22
shangliu.py
@ -2,7 +2,7 @@ from time import sleep
|
||||
from requests import get
|
||||
from pagermaid import version
|
||||
from pagermaid.listener import listener
|
||||
from pagermaid.utils import alias_command
|
||||
from pagermaid.utils import alias_command, client
|
||||
|
||||
|
||||
@listener(is_plugin=True, outgoing=True, command=alias_command("chp"),
|
||||
@ -11,10 +11,10 @@ async def chp(context):
|
||||
await context.edit("获取中 . . .")
|
||||
status = False
|
||||
for _ in range(20): # 最多尝试20次
|
||||
req = get("https://chp.shadiao.app/api.php?from=tntcrafthim")
|
||||
req = await client.get("https://api.shadiao.app/chp")
|
||||
if req.status_code == 200:
|
||||
res = req.text
|
||||
await context.edit(res, parse_mode='html', link_preview=False)
|
||||
res = req.json()
|
||||
await context.edit(res.get("data", {}).get("text", "什么都没有找到"), parse_mode='html', link_preview=False)
|
||||
status = True
|
||||
break
|
||||
else:
|
||||
@ -31,10 +31,10 @@ async def djt(context):
|
||||
await context.edit("获取中 . . .")
|
||||
status = False
|
||||
for _ in range(20): # 最多尝试20次
|
||||
req = get("https://du.shadiao.app/api.php?from=tntcrafthim")
|
||||
req = await client.get("https://api.shadiao.app/du")
|
||||
if req.status_code == 200:
|
||||
res = req.text
|
||||
await context.edit(res, parse_mode='html', link_preview=False)
|
||||
res = req.json()
|
||||
await context.edit(res.get("data", {}).get("text", "什么都没有找到"), parse_mode='html', link_preview=False)
|
||||
status = True
|
||||
break
|
||||
else:
|
||||
@ -50,7 +50,13 @@ async def djt(context):
|
||||
async def yxh(context):
|
||||
try:
|
||||
await context.edit("生成中 . . .")
|
||||
text = f"{context.parameter[0]}{context.parameter[1]}是怎么回事呢?{context.parameter[0]}相信大家都很熟悉,但是{context.parameter[0]}{context.parameter[1]}是怎么回事呢,下面就让小编带大家一起了解吧。\n{context.parameter[0]}{context.parameter[1]},其实就是{context.parameter[2]},大家可能会很惊讶{context.parameter[0]}怎么会{context.parameter[1]}呢?但事实就是这样,小编也感到非常惊讶。\n这就是关于{context.parameter[0]}{context.parameter[1]}的事情了,大家有什么想法呢,欢迎在评论区告诉小编一起讨论哦!"
|
||||
text = f"{context.parameter[0]}{context.parameter[1]}是怎么回事呢?" \
|
||||
f"{context.parameter[0]}相信大家都很熟悉," \
|
||||
f"但是{context.parameter[0]}{context.parameter[1]}是怎么回事呢,下面就让小编带大家一起了解吧。\n" \
|
||||
f"{context.parameter[0]}{context.parameter[1]},其实就是{context.parameter[2]}," \
|
||||
f"大家可能会很惊讶{context.parameter[0]}怎么会{context.parameter[1]}呢?但事实就是这样," \
|
||||
f"小编也感到非常惊讶。\n这就是关于{context.parameter[0]}{context.parameter[1]}的事情了," \
|
||||
f"大家有什么想法呢,欢迎在评论区告诉小编一起讨论哦!"
|
||||
except IndexError:
|
||||
await context.edit("使用方法:-yxh <主体> <事件> <原因>")
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user