From 362c05b5c8c9d9ee995c3963b6f48701a8bdc70b Mon Sep 17 00:00:00 2001 From: Moriarty-989 <69113033+Moriarty-989@users.noreply.github.com> Date: Tue, 9 Feb 2021 21:51:58 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20xjj=E3=80=81zpr=EF=BC=9A=E7=B1=BB?= =?UTF-8?q?=E4=BC=BCacg-multi=E7=AD=89=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=86=85?= =?UTF-8?q?=E5=85=B7=E4=B8=80=E4=BA=9B=E7=BE=8E=E5=9B=BE=EF=BC=8C=E5=85=BB?= =?UTF-8?q?=E7=9C=BC=20(#126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 发送一些好康的图片,养眼 --- list.json | 20 ++++++++++++++++++++ xjj.py | 41 +++++++++++++++++++++++++++++++++++++++++ zpr.py | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 xjj.py create mode 100644 zpr.py diff --git a/list.json b/list.json index 4312832..fa90445 100644 --- a/list.json +++ b/list.json @@ -389,6 +389,26 @@ "supported": true, "des-short": "上传和下载文件。", "des": "命令: transfer" + }, + { + "name": "xjj", + "version": "1.0", + "section": "daily", + "maintainer": "Moriarty-989", + "size": "1.4 kb", + "supported": true, + "des-short": "随机小姐姐写真。", + "des": "命令: xjj" + }, + { + "name": "zpr", + "version": "1.0", + "section": "daily", + "maintainer": "Moriarty-989", + "size": "1.4 kb", + "supported": true, + "des-short": "随机小姐姐或纸片人写真。", + "des": "命令: xjj" } ] } diff --git a/xjj.py b/xjj.py new file mode 100644 index 0000000..1a79c30 --- /dev/null +++ b/xjj.py @@ -0,0 +1,41 @@ +import random +from time import sleep +from requests import get +from pagermaid.listener import listener +from os import remove + + +@listener(is_plugin=True, outgoing=True, command="xjj", + description="随机小姐姐写真") +async def ghs(context): + await context.edit("拍小姐姐写真中 . . .") + status = False + for _ in range (10): #最多重试10次 + website = random.randint(0,0) + filename = "xjj" + str(random.random())[2:] + ".png" + try: + if website == 0: + img = get("https://api.pixivweb.com/api.php?return=img") + if img.status_code == 200: + with open(filename, 'wb') as f: + f.write(img.content) + await context.edit("写真我拍好辣,上传中 . . .") + await context.client.send_file(context.chat_id,filename,caption="小姐姐来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)") + status = True + break #成功了就赶紧结束啦! + except: + try: + remove(filename) + except: + pass + continue + try: + remove(filename) + except: + pass + try: + await context.delete() + except: + pass + if not status: + await context.client.send_message(context.chat_id,"出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。") diff --git a/zpr.py b/zpr.py new file mode 100644 index 0000000..c5f445b --- /dev/null +++ b/zpr.py @@ -0,0 +1,41 @@ +import random +from time import sleep +from requests import get +from pagermaid.listener import listener +from os import remove + + +@listener(is_plugin=True, outgoing=True, command="zpr", + description="随机小姐姐或纸片人写真") +async def ghs(context): + await context.edit("拍小姐姐或纸片人写真中 . . .") + status = False + for _ in range (10): #最多重试10次 + website = random.randint(0,0) + filename = "zpr" + str(random.random())[2:] + ".png" + try: + if website == 0: + img = get("https://api.pixivweb.com/anime18r.php?return=img") + if img.status_code == 200: + with open(filename, 'wb') as f: + f.write(img.content) + await context.edit("写真我拍好辣,上传中 . . .") + await context.client.send_file(context.chat_id,filename,caption="来辣~⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄)") + status = True + break #成功了就赶紧结束啦! + except: + try: + remove(filename) + except: + pass + continue + try: + remove(filename) + except: + pass + try: + await context.delete() + except: + pass + if not status: + await context.client.send_message(context.chat_id,"出错了呜呜呜 ~ 试了好多好多次都无法访问到服务器(没有颜色搞啦!) 。")