From 91a2bfa2a89aa1a1b1ebfdffad27790c94d5d90e Mon Sep 17 00:00:00 2001 From: KorenKrita Date: Wed, 12 Aug 2020 22:28:21 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A9=20mjx=20=E6=B7=98=E5=AE=9D?= =?UTF-8?q?=E4=B9=B0=E5=AE=B6=E7=A7=80=EF=BC=8C=E6=B7=98=E5=AE=9D=E6=B6=A9?= =?UTF-8?q?=E6=B0=94=E4=B9=B0=E5=AE=B6=E7=A7=80=EF=BC=8C=E4=B8=8A=E6=9E=B6?= =?UTF-8?q?=20(#7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + list.json | 10 ++++++++++ mjx.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 mjx.py diff --git a/README.md b/README.md index 9d12461..23b7044 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ - profile (资料类) - `autochangename` : 自动更新 last_name 为时间等。 - `throwit` : 生成一张 扔头像 图片。 + - `mjx` : 随机发一张淘宝买家秀 - daily (便民类) - `weather` : 查询天气。 - `xtao-some` : 一大堆便民功能。 diff --git a/list.json b/list.json index 56d2613..0a982bf 100644 --- a/list.json +++ b/list.json @@ -170,6 +170,16 @@ "des-short": "微博,知乎,抖音实时热搜,B站实时排行榜。", "des": "命令:wbrs,zhrs,dyrs,brank。" }, + { + "name": "mjx", + "version": "1.0", + "section": "profile", + "maintainer": "KorenKrita", + "size": "1 kb", + "supported": true, + "des-short": "随机带评价买家秀,随机涩气买家秀", + "des": "命令:mjx,sqmjx。" + }, { "name": "whois", "version": "1.0", diff --git a/mjx.py b/mjx.py new file mode 100644 index 0000000..2da782d --- /dev/null +++ b/mjx.py @@ -0,0 +1,29 @@ +import json +from requests import get +from pagermaid.listener import listener + + +@listener(is_plugin=True, outgoing=True, command="mjx", + description="随机一个淘宝带图评价。") +async def mjx(context): + await context.edit("获取中 . . .") + req = get("http://api.vvhan.com/api/tao?type=json") + if req.status_code == 200: + data = json.loads(req.text) + res = '' + '随机tb买家秀:' + '' + '\n买家评价:' + data['title'] + await context.edit(res, parse_mode='html', link_preview=True) + else: + await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。") + + +@listener(is_plugin=True, outgoing=True, command="sqmjx", + description="一个淘宝涩气买家秀。") +async def sqmjx(context): + await context.edit("获取中 . . .") + req = get("http://api.uomg.com/api/rand.img3?format=json") + if req.status_code == 200: + data = json.loads(req.text) + res = '' + '随机tb涩气买家秀' + '' + await context.edit(res, parse_mode='html', link_preview=True) + else: + await context.edit("出错了呜呜呜 ~ 无法访问到 API 服务器 。")