From ef5587b2e21cc1adb87f7a00892c7743cfad2ad5 Mon Sep 17 00:00:00 2001 From: xmengnet <794508986@qq.com> Date: Fri, 11 Jun 2021 09:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=9B=BE=E7=89=87=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=EF=BC=8C=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worker/k.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/worker/k.py b/worker/k.py index 4aac6e9..eb0e9c1 100644 --- a/worker/k.py +++ b/worker/k.py @@ -1,13 +1,15 @@ from zzcore import StdAns import requests + + class Ans(StdAns): def GETMSG(self): try: - picurl,status=Kemomimi() + picurl, status = Kemomimi() except: print() msg = '' - if status==200: + if status == 200: # 显示图标 # msg += f'[CQ:xml,data=' \ # f'' \ @@ -25,14 +27,14 @@ class Ans(StdAns): # 显示卡片图片 # msg += f'[CQ:cardimage,file={picurl},maxheight=200]' else: - msg+='图库丢了哦,不是咱的问题呀!' + msg += '图库丢了哦,不是咱的问题呀!' return msg def Kemomimi(): - url="http://api.aya1.xyz:6/random.php" + url = "http://api.aya1.xyz:6/random0.php" # 获取重定向后的地址 - imgurl=requests.get(url).url + imgurl = requests.get(url).url status = requests.get(url).status_code # print(imgurl)\ - return imgurl,status + return imgurl, status