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