From 3cf21d366e458a8ce1185d57567591c0a1675737 Mon Sep 17 00:00:00 2001 From: zkysimon Date: Thu, 9 Jun 2022 20:15:52 +0800 Subject: [PATCH] =?UTF-8?q?diss=20=E5=84=92=E9=9B=85=E9=9A=8F=E5=92=8C?= =?UTF-8?q?=E7=89=88=E7=A5=96=E5=AE=89=E8=AF=AD=E5=BD=95=20(#2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: omg-xtao <100690902+omg-xtao@users.noreply.github.com> --- diss/main.py | 12 ++++++++++++ list.json | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 diss/main.py diff --git a/diss/main.py b/diss/main.py new file mode 100644 index 0000000..966bf00 --- /dev/null +++ b/diss/main.py @@ -0,0 +1,12 @@ +from pyrogram import Client +from pagermaid.listener import listener +from pagermaid.utils import Message, client, edit_delete + + +@listener(command="diss", description="儒雅随和版祖安语录。") +async def diss(_: Client, message: Message): + for i in range(5): # 最多尝试5次 + req = await client.get("https://api.oddfar.com/yl/q.php?c=1009&encode=text") + if req.status_code == 200: + return await message.edit(req.text) + await edit_delete(message, "出错了呜呜呜 ~ 试了好多好多次都无法访问到 API 服务器 。") diff --git a/list.json b/list.json index 771281a..f62fade 100644 --- a/list.json +++ b/list.json @@ -149,6 +149,16 @@ "supported": true, "des-short": "微博,知乎,抖音实时热搜。", "des": "命令:wbrs,zhrs,dyrs。" + }, + { + "name": "diss", + "version": "1.0", + "section": "daily", + "maintainer": "xtaodada", + "size": "700 b", + "supported": true, + "des-short": "儒雅随和版祖安语录。", + "des": "儒雅随和版祖安语录。" } ] }