From 5149940c043e172c1aac2ce4bcc401d7eabf6d0c Mon Sep 17 00:00:00 2001
From: xmengnet <51263043+xmengnet@users.noreply.github.com>
Date: Sun, 18 Apr 2021 10:36:30 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Kemomimi=E5=9B=BE=E7=89=87?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
worker/k.py | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 worker/k.py
diff --git a/worker/k.py b/worker/k.py
new file mode 100644
index 0000000..4aac6e9
--- /dev/null
+++ b/worker/k.py
@@ -0,0 +1,38 @@
+from zzcore import StdAns
+import requests
+class Ans(StdAns):
+ def GETMSG(self):
+ try:
+ picurl,status=Kemomimi()
+ except:
+ print()
+ msg = ''
+ if status==200:
+ # 显示图标
+ # msg += f'[CQ:xml,data=' \
+ # f'' \
+ # f'- 来喽!!
' \
+ # f'' \
+ # f'' \
+ # f']'
+ msg = f'[CQ:xml,data=\n' \
+ f'\n' \
+ f'- ケモミミちゃん:Kemomimi酱来了~
\n' \
+ f' ' \
+ f']'
+ # 显示卡片图片
+ # msg += f'[CQ:cardimage,file={picurl},maxheight=200]'
+ else:
+ msg+='图库丢了哦,不是咱的问题呀!'
+ return msg
+
+
+def Kemomimi():
+ url="http://api.aya1.xyz:6/random.php"
+ # 获取重定向后的地址
+ imgurl=requests.get(url).url
+ status = requests.get(url).status_code
+ # print(imgurl)\
+ return imgurl,status