From 119915b5901f748f40bb745e98ba4e3bcec2387f Mon Sep 17 00:00:00 2001 From: TNTcraftHIM Date: Mon, 24 Aug 2020 15:42:20 +0800 Subject: [PATCH] Revert "Revert "meizi bug fixes, added diss"" This reverts commit 87413e87b24af128a3c5c56dde5a1bd44b3c8f21. --- diss.py | 24 ++++++++++++++++++++++++ list.json | 12 +++++++++++- meizi.py | 4 ++-- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 diss.py diff --git a/diss.py b/diss.py new file mode 100644 index 0000000..99e03a4 --- /dev/null +++ b/diss.py @@ -0,0 +1,24 @@ +from requests import get +from pagermaid.listener import listener + +@listener(is_plugin=True, outgoing=True, command="diss", + description="儒雅随和版祖安语录。") +async def diss(context): + await context.edit("获取中 . . .") + req = get("https://nmsl.shadiao.app/api.php?level=min&from=tnt") + if req.status_code == 200: + res = req.text + await context.edit(res, parse_mode='html', link_preview=False) + else: + await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。") + +@listener(is_plugin=True, outgoing=True, command="biss", + description="加带力度版祖安语录。") +async def biss(context): + await context.edit("获取中 . . .") + req = get("https://nmsl.shadiao.app/api.php?&from=tnt") + if req.status_code == 200: + res = req.text + await context.edit(res, parse_mode='html', link_preview=False) + else: + await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。") \ No newline at end of file diff --git a/list.json b/list.json index 9da1fa8..f1f5f93 100644 --- a/list.json +++ b/list.json @@ -232,13 +232,23 @@ }, { "name": "acg-multi", - "version": "1.1", + "version": "1.2", "section": "profile", "maintainer": "TNTcraftHIM", "size": "2.4 kb", "supported": true, "des-short": "多网站随机获取ACG图", "des": "从几个不同的图库中随机获取二刺螈(bushi)ACG图片,基本都是手机尺寸的图。命令:acgm。" + }, + { + "name": "diss", + "version": "1.0", + "section": "chat", + "maintainer": "TNTcraftHIM", + "size": "1.0 kb", + "supported": true, + "des-short": "祖安对线语录", + "des": "让你在祖安大舞台能够时而儒雅,时而火力全开的对线。命令:diss,biss。" } ] } diff --git a/meizi.py b/meizi.py index 06dd5b8..e138531 100644 --- a/meizi.py +++ b/meizi.py @@ -1,4 +1,4 @@ -from random import randint +import random from time import sleep from requests import get from pagermaid.listener import listener @@ -11,7 +11,7 @@ async def meizi(context): await context.edit("获取中 . . .") status = False for _ in range (20): #最多重试20次 - website = randint(0, 13) + website = random.randint(0, 13) if website == 0: img = get("https://mm.52.mk") elif website == 1: