From b39fd4d21d1a051f3c11e3feab6b1ff7b60bea55 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 9 Mar 2020 10:26:18 +0800 Subject: [PATCH 01/78] add gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..05cc0cf --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +env +__pycache__ +.vscode From d398d360a692bc4007828bf45fe2f794b3ffa131 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 15:42:57 +0800 Subject: [PATCH 02/78] music change api --- config.py | 4 +++- main.py | 5 ++--- worker/music.py | 6 ++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config.py b/config.py index 1301d36..381f5b2 100644 --- a/config.py +++ b/config.py @@ -4,4 +4,6 @@ APIURL = 'http://127.0.0.1:5700/' AUTHORIZATION = '' -PORT = 5580 \ No newline at end of file +PORT = 5580 + + diff --git a/main.py b/main.py index c138b5c..0b7e4b0 100644 --- a/main.py +++ b/main.py @@ -9,6 +9,5 @@ def whenmsg(): ZZRouter(request.get_json()) return '' -app.run(host='0.0.0.0', port=PORT) -if __name__ == '__main__': - app.run() +app.run(host='0.0.0.0',debug=True) + diff --git a/worker/music.py b/worker/music.py index 0d5aacb..59a4fbc 100644 --- a/worker/music.py +++ b/worker/music.py @@ -6,10 +6,12 @@ class Ans(StdAns): if len(self.parms) < 2: return '不加参数是坏文明!' - url = 'http://47.100.45.234/search' + url = 'https://api.imjad.cn/cloudmusic/' params = { - 'keywords':self.raw_msg['message'][6:], + 'type': 'search', + 'search_type': 1, 'limit': 1, + 's':self.raw_msg['message'][6:], } try: resp = requests.get(url=url,params=params).json() From d3506cf31acb5a1ac0d2e20f2f9c6ff1c9b7f75c Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 15:46:37 +0800 Subject: [PATCH 03/78] music change api ++ --- main.py | 2 +- worker/echo.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0b7e4b0..d031539 100644 --- a/main.py +++ b/main.py @@ -9,5 +9,5 @@ def whenmsg(): ZZRouter(request.get_json()) return '' -app.run(host='0.0.0.0',debug=True) +app.run(host='0.0.0.0',port = PORT, debug=True) diff --git a/worker/echo.py b/worker/echo.py index 83c95e6..04db737 100644 --- a/worker/echo.py +++ b/worker/echo.py @@ -7,7 +7,7 @@ class Ans(StdAns): return '不加参数是坏文明!' r = random.randint(1,3) if r == 1: - msg = self.raw_msg['message'][5:] + msg = self.raw_msg['message'][6:] elif r == 2: msg = "汝以为咱会复读的嘛!\n(╯' - ')╯︵ ┻━┻\n" + self.raw_msg['message'][5:] elif r == 3: From 8732bdb13cfd5a89a36790c3619de9387b15f275 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 15:47:50 +0800 Subject: [PATCH 04/78] music change api +++ --- config.py => sample_config.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config.py => sample_config.py (100%) diff --git a/config.py b/sample_config.py similarity index 100% rename from config.py rename to sample_config.py From 370c6862f6c3b97e9a76f4713baef86f12e57a9a Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 16:47:54 +0800 Subject: [PATCH 05/78] pixiv --- .gitignore | 1 + worker/pixiv.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 worker/pixiv.py diff --git a/.gitignore b/.gitignore index 05cc0cf..1dc8a82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ env __pycache__ .vscode +config.py \ No newline at end of file diff --git a/worker/pixiv.py b/worker/pixiv.py new file mode 100644 index 0000000..7a9cbc2 --- /dev/null +++ b/worker/pixiv.py @@ -0,0 +1,32 @@ +from zzcore import StdAns +import requests + +class Ans(StdAns): + AllowGroup = [959613860] + def GETMSG(self): + url = 'https://api.lolicon.app/setu/' + params = { + 'apikey': '095536795e6f0715593173', + } + + if len(self.parms) < 2: + try: + resp = requests.get(url=url,params=params).json() + picurl = resp['data'][0]['url'] + msg = picurl + except Exception as e: + print(e) + msg = '什么东西坏掉了,大概是Pixiv吧...不可能是咱!' + return msg + + else: + keyword = self.raw_msg['message'][7:] + params['keyword'] = keyword + try: + resp = requests.get(url=url,params=params).json() + picurl = resp['data'][0]['url'] + msg = picurl + except Exception as e: + print(e) + msg = '咱没查到,也有可能是Pixiv坏掉了' + return msg \ No newline at end of file From 1bb468cdb86ec024905c69c2ee38d111c1345f81 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 17:11:55 +0800 Subject: [PATCH 06/78] update pixiv --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 7a9cbc2..22595bb 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -2,7 +2,7 @@ from zzcore import StdAns import requests class Ans(StdAns): - AllowGroup = [959613860] + AllowGroup = [959613860,805197917] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 94e2a1de9fcf637806adfc979386ed016bbb5529 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 17:14:24 +0800 Subject: [PATCH 07/78] update pixiv --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 22595bb..3e717b4 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -2,7 +2,7 @@ from zzcore import StdAns import requests class Ans(StdAns): - AllowGroup = [959613860,805197917] + AllowGroup = [805197917,959613860] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 04f065befffece30d4b1619720936df131ead10e Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 16 Mar 2020 17:18:32 +0800 Subject: [PATCH 08/78] update pixiv --- route.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/route.py b/route.py index 59880f0..20c1b3e 100644 --- a/route.py +++ b/route.py @@ -5,7 +5,8 @@ def ZZRouter(data): gid = data['group_id'] role = data['sender']['role'] parms = str.split(data['message'][1:]) - if not parms: + print(uid,gid,role,parms) + if parms == []: parms[0] = 'help' worker = parms[0] From 9c3abb4c7ec383ece79c9558bd51c5afa08ccdee Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 17 Mar 2020 14:20:21 +0800 Subject: [PATCH 09/78] update pixiv --- worker/pixiv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 3e717b4..ac9ed67 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -1,12 +1,14 @@ from zzcore import StdAns import requests +from config import LOLIKEY + class Ans(StdAns): AllowGroup = [805197917,959613860] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { - 'apikey': '095536795e6f0715593173', + 'apikey': LOLIKEY, } if len(self.parms) < 2: From cff7dac933b0fe98e31113f3141203326d496722 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 20 Mar 2020 22:46:11 +0800 Subject: [PATCH 10/78] add redis db --- zzcore.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/zzcore.py b/zzcore.py index 16d48d6..01f9103 100644 --- a/zzcore.py +++ b/zzcore.py @@ -1,7 +1,8 @@ -import requests -import json +import requests, json, redis from config import APIURL, ALLWORKERS, AUTHORIZATION from worker import emmm +pool = redis.ConnectionPool(host='127.0.0.1', port=6379, decode_responses=True) +r = redis.Redis(connection_pool=pool) class StdAns(): AllowGroup = [] @@ -18,6 +19,11 @@ class StdAns(): self.role = role self.raw_msg = raw_msg + def DATAGET(self): + return r.hgetall(self.parms[0]) + + def DATASET(self,data): + r.hmset(self.parms[0],data) def CheckPermission(self): if self.AllowGroup and self.gid not in self.AllowGroup: @@ -43,4 +49,4 @@ class StdAns(): 'group_id' : self.gid, 'message': msg } - requests.post(url = url, data = json.dumps(data),headers = Headers) + return requests.post(url = url, data = json.dumps(data),headers = Headers).json()['data']['message_id'] From bc26c1257b5bddc5c147d454a63a159102a42594 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 20 Mar 2020 22:46:23 +0800 Subject: [PATCH 11/78] add inx --- worker/inx.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 worker/inx.py diff --git a/worker/inx.py b/worker/inx.py new file mode 100644 index 0000000..8c3da5d --- /dev/null +++ b/worker/inx.py @@ -0,0 +1,27 @@ +from zzcore import StdAns +import requests, time + +class Ans(StdAns): + def GETMSG(self): + if len(self.parms) < 2: + return '不加参数是坏文明!' + cmd = self.parms[1] + AllowCmd = ['start','stop'] + + if cmd in AllowCmd: + if cmd == 'stop': + self.DATASET({'status':'0'}) + return '我已知晓你希望 inx 停止.' + if cmd == 'start': + self.DATASET({'status':'1'}) + self.sendmsg('inx 启动!') + while(self.DATAGET()['status'] == 1): + req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx") + num = req.text[28:].split(",")[1] + self.sendmsg('标普500现在情况: ' + num) + time.sleep(10) + + return "现在 inx 真的停了!" + + else: + return '汝是不是在inx后面添加了奇怪的参数,咱可只知道 start 和 stop。' \ No newline at end of file From e1b9999c0d292bd5d19b1ee634ef11ee3c17ac59 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 20 Mar 2020 22:51:35 +0800 Subject: [PATCH 12/78] inx ++ --- worker/inx.py | 5 +++-- zzcore.py | 12 ++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/worker/inx.py b/worker/inx.py index 8c3da5d..73c74b2 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -15,11 +15,12 @@ class Ans(StdAns): if cmd == 'start': self.DATASET({'status':'1'}) self.sendmsg('inx 启动!') - while(self.DATAGET()['status'] == 1): + while(self.DATAGET()['status'] == '1'): req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx") num = req.text[28:].split(",")[1] - self.sendmsg('标普500现在情况: ' + num) + msgid = self.sendmsg('标普500现在情况: ' + num) time.sleep(10) + self.delmsg(msgid) return "现在 inx 真的停了!" diff --git a/zzcore.py b/zzcore.py index 01f9103..1f37c15 100644 --- a/zzcore.py +++ b/zzcore.py @@ -50,3 +50,15 @@ class StdAns(): 'message': msg } return requests.post(url = url, data = json.dumps(data),headers = Headers).json()['data']['message_id'] + + + def delmsg(self,msgid): + url = APIURL + "delete_msg" + Headers = { + 'content-type': 'application/json', + 'Authorization':'Bearer ' + AUTHORIZATION + } + data = { + 'message_id' : msgid, + } + requests.post(url = url, data = json.dumps(data),headers = Headers) \ No newline at end of file From 5324ff1d1777a8286ee56ced189e08c02d3481ad Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 24 Mar 2020 20:48:05 +0800 Subject: [PATCH 13/78] inx more --- worker/inx.py | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/worker/inx.py b/worker/inx.py index 73c74b2..53cfd77 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -15,14 +15,35 @@ class Ans(StdAns): if cmd == 'start': self.DATASET({'status':'1'}) self.sendmsg('inx 启动!') + pinx = 0 + pixic = 0 + pdji = 0 while(self.DATAGET()['status'] == '1'): - req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx") - num = req.text[28:].split(",")[1] - msgid = self.sendmsg('标普500现在情况: ' + num) - time.sleep(10) - self.delmsg(msgid) - + inx, ixic, dji = getMG() + msg = '标普500 现在的涨跌幅度: ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克现在的涨跌幅度: ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯指数现在的涨跌幅: ' + dji + ' ' + emoji(pdji,dji) + self.sendmsg(msg) + pinx = inx + pixic = ixic + pdji = dji + time.sleep(16) + return "现在 inx 真的停了!" else: - return '汝是不是在inx后面添加了奇怪的参数,咱可只知道 start 和 stop。' \ No newline at end of file + return '汝是不是在inx后面添加了奇怪的参数,咱可只知道 start 和 stop。' + + +def getMG(): + req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx,gb_$ixic,gb_$dji").text.split(',') + return req[2], req[29], req[56] + +def emoji(p,n): + n = float(n) + p = float(p) + if n < p: + emoji = '🟩🟩🟩🎉\n' + elif n > p: + emoji = '🟥🟥🟥😢\n' + else : + emoji = '⬜⬜⬜🌚\n' + return emoji From 30397a7f071cc5a7c35439d5da935579b1a57c58 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 24 Mar 2020 20:53:49 +0800 Subject: [PATCH 14/78] inx emoji --- worker/inx.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/worker/inx.py b/worker/inx.py index 53cfd77..3c87094 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -14,14 +14,15 @@ class Ans(StdAns): return '我已知晓你希望 inx 停止.' if cmd == 'start': self.DATASET({'status':'1'}) - self.sendmsg('inx 启动!') + # self.sendmsg('inx 启动!') pinx = 0 pixic = 0 pdji = 0 while(self.DATAGET()['status'] == '1'): inx, ixic, dji = getMG() - msg = '标普500 现在的涨跌幅度: ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克现在的涨跌幅度: ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯指数现在的涨跌幅: ' + dji + ' ' + emoji(pdji,dji) - self.sendmsg(msg) + msg = '标普 500 : ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克 : ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯指数: ' + dji + ' ' + emoji(pdji,dji) + # self.sendmsg(msg) + print(msg) pinx = inx pixic = ixic pdji = dji @@ -41,9 +42,9 @@ def emoji(p,n): n = float(n) p = float(p) if n < p: - emoji = '🟩🟩🟩🎉\n' + emoji = '📉📉📉🎉\n' elif n > p: - emoji = '🟥🟥🟥😢\n' + emoji = '📈📈📈😢\n' else : emoji = '⬜⬜⬜🌚\n' return emoji From 2cda6f69ec0bd6a13816a3b754266f8d25239035 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 24 Mar 2020 20:55:50 +0800 Subject: [PATCH 15/78] update pixiv --- worker/inx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/inx.py b/worker/inx.py index 3c87094..c873c79 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -14,15 +14,15 @@ class Ans(StdAns): return '我已知晓你希望 inx 停止.' if cmd == 'start': self.DATASET({'status':'1'}) - # self.sendmsg('inx 启动!') + self.sendmsg('inx 启动!') pinx = 0 pixic = 0 pdji = 0 while(self.DATAGET()['status'] == '1'): inx, ixic, dji = getMG() msg = '标普 500 : ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克 : ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯指数: ' + dji + ' ' + emoji(pdji,dji) - # self.sendmsg(msg) - print(msg) + self.sendmsg(msg) + # print(msg) pinx = inx pixic = ixic pdji = dji From 4fbc4ee26266fda0eb65821e78ba5508f1e90962 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 24 Mar 2020 20:57:39 +0800 Subject: [PATCH 16/78] update inx --- worker/inx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/inx.py b/worker/inx.py index c873c79..3c0a2b1 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -20,7 +20,7 @@ class Ans(StdAns): pdji = 0 while(self.DATAGET()['status'] == '1'): inx, ixic, dji = getMG() - msg = '标普 500 : ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克 : ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯指数: ' + dji + ' ' + emoji(pdji,dji) + msg = '标普 500: ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克: ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯 : ' + dji + ' ' + emoji(pdji,dji) self.sendmsg(msg) # print(msg) pinx = inx From d5628dea7bf5e3ae81d0ee3c7dce065e247d3faa Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 24 Mar 2020 20:58:31 +0800 Subject: [PATCH 17/78] update inx --- worker/inx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/inx.py b/worker/inx.py index 3c0a2b1..bb5445f 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -20,7 +20,7 @@ class Ans(StdAns): pdji = 0 while(self.DATAGET()['status'] == '1'): inx, ixic, dji = getMG() - msg = '标普 500: ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克: ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯 : ' + dji + ' ' + emoji(pdji,dji) + msg = '标普 500 : ' + inx + ' ' + emoji(pinx,inx) + '纳斯达克 : ' + ixic + ' ' + emoji(pixic,ixic) + '道琼斯 : ' + dji + ' ' + emoji(pdji,dji) self.sendmsg(msg) # print(msg) pinx = inx From f7bbf6a36c1594e75c82612e2133845923854a67 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 2 Apr 2020 21:48:59 +0800 Subject: [PATCH 18/78] update inx --- worker/inx.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worker/inx.py b/worker/inx.py index bb5445f..eea7a26 100644 --- a/worker/inx.py +++ b/worker/inx.py @@ -35,8 +35,11 @@ class Ans(StdAns): def getMG(): - req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx,gb_$ixic,gb_$dji").text.split(',') - return req[2], req[29], req[56] + req = requests.get("https://hq.sinajs.cn/etag.php?_=1584712625172&list=gb_$inx,gb_$ixic,gb_$dji").text.split(';') + inx = req[0].split(',')[2] + ixic = req[1].split(',')[2] + dji = req[2].split(',')[2] + return inx, ixic, dji def emoji(p,n): n = float(n) From fae3a54bfc08d25f792612ee2ccf91f0adddbfd0 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 7 Apr 2020 19:11:32 +0800 Subject: [PATCH 19/78] music jeeas --- worker/music.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/worker/music.py b/worker/music.py index 59a4fbc..0f6dbe5 100644 --- a/worker/music.py +++ b/worker/music.py @@ -6,15 +6,16 @@ class Ans(StdAns): if len(self.parms) < 2: return '不加参数是坏文明!' - url = 'https://api.imjad.cn/cloudmusic/' + # url = 'https://api.imjad.cn/cloudmusic/' + url = 'https://music.jeeas.cn/v1/search' params = { - 'type': 'search', - 'search_type': 1, 'limit': 1, + 'from': 'music', 's':self.raw_msg['message'][6:], } try: resp = requests.get(url=url,params=params).json() + # print(resp) musicid = resp['result']['songs'][0]['id'] msg = '[CQ:music,type=163,id='+ str(musicid)+']' except Exception as e: From b43e8af97f615844a1db60d783e3c9238a8a30cd Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 26 Apr 2020 21:54:38 +0800 Subject: [PATCH 20/78] music use local api --- worker/music.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/music.py b/worker/music.py index 0f6dbe5..2979974 100644 --- a/worker/music.py +++ b/worker/music.py @@ -7,11 +7,11 @@ class Ans(StdAns): return '不加参数是坏文明!' # url = 'https://api.imjad.cn/cloudmusic/' - url = 'https://music.jeeas.cn/v1/search' + # url = 'https://music.jeeas.cn/v1/search' + url = 'http://mc.sakuya.love:3000/search' params = { 'limit': 1, - 'from': 'music', - 's':self.raw_msg['message'][6:], + 'keywords':self.raw_msg['message'][6:], } try: resp = requests.get(url=url,params=params).json() From 8ad31206d174d1d0eab44a248ac0322552daa3e3 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 27 Apr 2020 11:27:16 +0800 Subject: [PATCH 21/78] add touhou group --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index ac9ed67..b239307 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860] + AllowGroup = [805197917,959613860,343700338] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From bbf63593a33045a0e2f159bcd658848ef1aeea82 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 10:50:13 +0800 Subject: [PATCH 22/78] add xizse group --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index b239307..acab7f2 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338] + AllowGroup = [805197917,959613860,343700338,125733077] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 4a4012df066621209bbc2aa158380ef95e255aa4 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:32:45 +0800 Subject: [PATCH 23/78] add pcr --- worker/pcr.py | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 worker/pcr.py diff --git a/worker/pcr.py b/worker/pcr.py new file mode 100644 index 0000000..72c6587 --- /dev/null +++ b/worker/pcr.py @@ -0,0 +1,214 @@ +import json +from zzcore import StdAns + +AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化'] + +status = { + 'all_player':{ + '1318000868': { + 'id':'十六夜咲夜', + '余刀': 3, + '加时刀': 0, + # 'SL':1 + }, + }, + 'boss_num': 0, + 'boss_hp': 0, + 'dao':{ + 'qq':1318000868, + '类型':'普通刀', + }, + 'tree':[] +} + +class Ans(StdAns): + AllowGroup = [125733077] + + def GETMSG(self): + if len(self.parms) < 2: + return '不加参数是坏文明!' + + cmd = self.parms[1] + if cmd not in AllowCMD: + return '没有 ' + cmd + ' 这个命令,请检查。' + + + try: + nowdata = json.loads(self.DATAGET()['data']) + except: + return '请管理员先初始化,初始化会将进度设置为第一周目第一个Boss,成员数据不会丢失。' + + + if cmd == '初始化': + if self.role not in ['owner','admin'] and self.uid != 1318000868: + return '你没有权限执行初始化。' + else: + try: + all_player = nowdata['all_player'] + except: + all_player = {} + + nowdata = {} + nowdata['all_player'] = all_player + nowdata['boss_num'] = 1 + nowdata['boss_hp'] = -1 + nowdata['dao'] = { + 'qq':0, + '类型':'普通刀', + } + nowdata['tree'] = [] + self.DATASET({'data':json.dumps(nowdata)}) + return '初始化完成!请使用\n /pcr 血量 xxxx \n 来设置第一周目第一个Boss的总血量。' + + if cmd == '登记': + nickname = self.raw_msg['message'][8:] + if nickname: + player = { + 'id':nickname, + '余刀': 3, + '加时刀': 0, + # 'SL':1 + } + + nowdata['all_player'][str(self.gid)] = player + self.DATASET({'data':json.dumps(nowdata)}) + + return '[CQ:at,qq=' + str(self.uid) + ']' + '游戏id设置为 ' + nickname + + else: + return '登记失败,请使用合法的游戏id。' + + if cmd == '血量': + if self.role not in ['owner','admin'] and self.uid != 1318000868: + return '你没有权限设置血量。' + else: + try: + hp = int(self.parms[2]) + except: + return '血量应该是整数!' + + nowdata['boss_hp'] = hp + self.DATASET({'data':json.dumps(nowdata)}) + return '现在' + bossname(int(nowdata['boss_num'])) +'的血量被设置为' + str(hp) + + if cmd == '新的一天': + if self.role not in ['owner','admin'] and self.uid != 1318000868: + return '你没有权限新的一天。' + else: + for value in nowdata['all_player'].itervalues(): + value['余刀'] == 3 + value['加时刀'] == 0 + # value['SL'] == 1 + self.DATASET({'data':json.dumps(nowdata)}) + return '新的一天已经开始,大家各有3刀剩余了。' + + + if cmd == '进度': + return bossname(int(nowdata['boss_num'])) + '\n剩余血量:' + str(nowdata['boss_hp']) + + if cmd == '申请出刀': + try: + nowplayer = nowdata['all_player'][str(self.uid)] + except: + return '您未登记。' + daoqq = nowdata['dao']['qq'] + if daoqq != 0 and daoqq not in nowdata['tree']: + return nowdata['all_player'][str(daoqq)]['id'] + '正在出刀,请等待他结算或挂树.' + elif nowplayer['余刀'] + nowdata['加时刀'] < 1: + return '您已无刀可出。' + else: + nowdata['dao']['qq'] = self.uid + if nowplayer['加时刀'] > 0: + nowdata['dao']['类型'] = '加时刀' + else: + nowdata['dao']['类型'] = '普通刀' + + self.DATASET({'data':json.dumps(nowdata)}) + return nowplayer['id'] + '出' + nowdata['dao']['类型'] + '讨伐' + bossname(int(nowdata['boss_num'])) + '\n剩余血量:' + str(nowdata['boss_hp']) + + + if cmd == '报刀': + try: + nowplayer = nowdata['all_player'][str(self.uid)] + except: + return '您未登记。' + + try: + jianhp = int(self.parms[2]) + except: + return '打掉的血量应该是整数!' + + newhp = nowdata['boss_hp'] - jianhp + # BOSS 没死 + if newhp > 0: + nowdata['boss_hp'] = newhp + nowdata['dao']['qq'] = 0 + if nowdata['dao']['类型'] == '加时刀': + nowplayer['加时刀'] = 0 + else: + nowplayer['余刀'] = nowplayer['余刀'] - 1 + + nowdata['all_player'][str(self.uid)] = nowplayer + self.DATASET({'data':json.dumps(nowdata)}) + + return nowplayer['id'] + '打了' + bossname(int(nowdata['boss_num'])) + str(jianhp) + '\n剩余血量:' + str(nowdata['boss_hp']) + #BOSS 死了 + else: + nowdata['boss_hp'] = 0 + nowdata['boss_num'] = nowdata['boss_num'] + 1 + nowdata['dao']['qq'] = 0 + nowdata['tree'] = [] + if nowdata['dao']['类型'] == '加时刀': + nowplayer['加时刀'] = 0 + else: + nowplayer['余刀'] = nowplayer['余刀'] - 1 + nowplayer['加时刀'] = 1 + + nowdata['all_player'][str(self.uid)] = nowplayer + self.DATASET({'data':json.dumps(nowdata)}) + + return nowplayer['id'] + '击杀了' + bossname(int(nowdata['boss_num'])-1) + '\n现在进入' + bossname(int(nowdata['boss_num'])) + '\n挂树的同学已经全部下树' + + + if cmd == '挂树': + try: + nowplayer = nowdata['all_player'][str(self.uid)] + except: + return '您未登记。' + + if nowdata['dao']['qq'] != self.uid: + return '您未出刀,挂个毛树' + + # elif nowplayer['SL'] == 1: + + else: + nowdata['dao']['qq'] = 0 + nowdata['tree'] = nowdata['tree'].append(self.uid) + self.DATASET({'data':json.dumps(nowdata)}) + return '已挂树' + + if cmd == '查树': + on_tree_players = '' + for p in nowdata['tree']: + on_tree_players = on_tree_players + nowdata['all_player'][str(p)]['id'] + '\n' + return '树上的有\n' + on_tree_players + + if cmd == '查刀': + alldao = '' + for value in nowdata['all_player'].itervalues(): + alldao = value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + '\n' + return alldao + + + + +def bossname(num): + zm = int(num/5)+1 + z = num%5 + + if z == 0: + z = 5 + zm = zm - 1 + + return '第'+ str(zm) + '周目第' + str(z) + 'Boss' + From 9c82c0f66717dfd85d7887a96328130fb3d4d4b7 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:38:05 +0800 Subject: [PATCH 24/78] fix pcr --- worker/pcr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index 72c6587..5fe4a1e 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -36,7 +36,10 @@ class Ans(StdAns): try: nowdata = json.loads(self.DATAGET()['data']) except: - return '请管理员先初始化,初始化会将进度设置为第一周目第一个Boss,成员数据不会丢失。' + if cmd == '初始化': + nowdata = {} + else: + return '请管理员先初始化,初始化会将进度设置为第一周目第一个Boss,成员数据不会丢失。' if cmd == '初始化': From e5fa2b260537cc7ef68aef62da78b65f488f37ee Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:39:54 +0800 Subject: [PATCH 25/78] fix pcr --- worker/pcr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 5fe4a1e..e1cfdac 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -99,8 +99,8 @@ class Ans(StdAns): return '你没有权限新的一天。' else: for value in nowdata['all_player'].itervalues(): - value['余刀'] == 3 - value['加时刀'] == 0 + value['余刀'] = 3 + value['加时刀'] = 0 # value['SL'] == 1 self.DATASET({'data':json.dumps(nowdata)}) return '新的一天已经开始,大家各有3刀剩余了。' From d9f8806bdf8fcca677f45a08ec1ab52bfc95da43 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:41:53 +0800 Subject: [PATCH 26/78] fix pcr --- worker/pcr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index e1cfdac..6ea9877 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -98,7 +98,7 @@ class Ans(StdAns): if self.role not in ['owner','admin'] and self.uid != 1318000868: return '你没有权限新的一天。' else: - for value in nowdata['all_player'].itervalues(): + for value in nowdata['all_player'].values(): value['余刀'] = 3 value['加时刀'] = 0 # value['SL'] == 1 @@ -198,7 +198,7 @@ class Ans(StdAns): if cmd == '查刀': alldao = '' - for value in nowdata['all_player'].itervalues(): + for value in nowdata['all_player'].values(): alldao = value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + '\n' return alldao From 2b8e53ef58346e96215065503b46911653e9b337 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:45:30 +0800 Subject: [PATCH 27/78] fix pcr --- worker/pcr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index 6ea9877..faf35df 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -73,7 +73,7 @@ class Ans(StdAns): # 'SL':1 } - nowdata['all_player'][str(self.gid)] = player + nowdata['all_player'][str(self.uid)] = player self.DATASET({'data':json.dumps(nowdata)}) return '[CQ:at,qq=' + str(self.uid) + ']' + '游戏id设置为 ' + nickname From 999cdce4fd95d43221343bebea7ee59b08241835 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:49:23 +0800 Subject: [PATCH 28/78] fix pcr --- worker/pcr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index faf35df..a27fbbd 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -117,7 +117,7 @@ class Ans(StdAns): daoqq = nowdata['dao']['qq'] if daoqq != 0 and daoqq not in nowdata['tree']: return nowdata['all_player'][str(daoqq)]['id'] + '正在出刀,请等待他结算或挂树.' - elif nowplayer['余刀'] + nowdata['加时刀'] < 1: + elif nowplayer['余刀'] + nowplayer['加时刀'] < 1: return '您已无刀可出。' else: nowdata['dao']['qq'] = self.uid From 4186968d6ce1f0c5e34351db5e269e1a8383942a Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:53:26 +0800 Subject: [PATCH 29/78] fix pcr --- worker/pcr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/worker/pcr.py b/worker/pcr.py index a27fbbd..dc28893 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -102,6 +102,7 @@ class Ans(StdAns): value['余刀'] = 3 value['加时刀'] = 0 # value['SL'] == 1 + nowdata['tree'] = [] self.DATASET({'data':json.dumps(nowdata)}) return '新的一天已经开始,大家各有3刀剩余了。' From bd6f0c26ba4bf8a88187d9659cb9b6999a1bc534 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 16:56:06 +0800 Subject: [PATCH 30/78] fix pcr --- worker/pcr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index dc28893..42db912 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -200,7 +200,7 @@ class Ans(StdAns): if cmd == '查刀': alldao = '' for value in nowdata['all_player'].values(): - alldao = value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + '\n' + alldao = alldao + value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + '\n' return alldao From 6c1e0e9cce443fd3f2040a6c70118dad3789d129 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:08:54 +0800 Subject: [PATCH 31/78] fix pcr --- worker/pcr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index 42db912..177f4c8 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -171,7 +171,7 @@ class Ans(StdAns): nowdata['all_player'][str(self.uid)] = nowplayer self.DATASET({'data':json.dumps(nowdata)}) - return nowplayer['id'] + '击杀了' + bossname(int(nowdata['boss_num'])-1) + '\n现在进入' + bossname(int(nowdata['boss_num'])) + '\n挂树的同学已经全部下树' + return nowplayer['id'] + '击杀了' + bossname(int(nowdata['boss_num'])-1) + '\n现在进入' + bossname(int(nowdata['boss_num'])) + '\n挂树的同学已经全部下树\n请使用\n /pcr 血量 xxxx \n 来设置新Boss的总血量' if cmd == '挂树': From d5975457837565cf839c593100c21d0f0189c7b1 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:13:00 +0800 Subject: [PATCH 32/78] fix pcr --- worker/pcr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker/pcr.py b/worker/pcr.py index 177f4c8..3005568 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -187,6 +187,8 @@ class Ans(StdAns): else: nowdata['dao']['qq'] = 0 + print(nowdata['tree']) + print(type(nowdata['tree'])) nowdata['tree'] = nowdata['tree'].append(self.uid) self.DATASET({'data':json.dumps(nowdata)}) return '已挂树' From 92ee06bc10a1610772a5297b25e09157ab42fecf Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:13:21 +0800 Subject: [PATCH 33/78] fix pcr --- worker/pcr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index 3005568..e989d96 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -22,7 +22,7 @@ status = { } class Ans(StdAns): - AllowGroup = [125733077] + # AllowGroup = [125733077] def GETMSG(self): if len(self.parms) < 2: From 11496f906341d4f8b00dbcfdf8d7bca87fe16822 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:19:39 +0800 Subject: [PATCH 34/78] fix pcr --- worker/pcr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker/pcr.py b/worker/pcr.py index e989d96..64cc278 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -190,6 +190,8 @@ class Ans(StdAns): print(nowdata['tree']) print(type(nowdata['tree'])) nowdata['tree'] = nowdata['tree'].append(self.uid) + print(nowdata['tree']) + print(type(nowdata['tree'])) self.DATASET({'data':json.dumps(nowdata)}) return '已挂树' From 1ac23e147c978a0beffb8fcfbb7e99a27ca4fc96 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:27:59 +0800 Subject: [PATCH 35/78] fix pcr --- worker/pcr.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 64cc278..837f3b8 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -22,7 +22,7 @@ status = { } class Ans(StdAns): - # AllowGroup = [125733077] + AllowGroup = [125733077] def GETMSG(self): if len(self.parms) < 2: @@ -184,14 +184,16 @@ class Ans(StdAns): return '您未出刀,挂个毛树' # elif nowplayer['SL'] == 1: - + elif self.uid in nowdata['tree']: + return '您已经在树上了。' + else: nowdata['dao']['qq'] = 0 - print(nowdata['tree']) - print(type(nowdata['tree'])) - nowdata['tree'] = nowdata['tree'].append(self.uid) - print(nowdata['tree']) - print(type(nowdata['tree'])) + # print(nowdata['tree']) + # print(type(nowdata['tree'])) + nowdata['tree'].append(self.uid) + # print(nowdata['tree']) + # print(type(nowdata['tree'])) self.DATASET({'data':json.dumps(nowdata)}) return '已挂树' From fe20c98d9ad840b1152dd758aa0c990b64af800a Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:30:08 +0800 Subject: [PATCH 36/78] fix pcr --- worker/pcr.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 837f3b8..8b36df5 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -180,13 +180,12 @@ class Ans(StdAns): except: return '您未登记。' - if nowdata['dao']['qq'] != self.uid: - return '您未出刀,挂个毛树' + if self.uid in nowdata['tree']: + return '您已经在树上了。' # elif nowplayer['SL'] == 1: - elif self.uid in nowdata['tree']: - return '您已经在树上了。' - + elif nowdata['dao']['qq'] != self.uid: + return '您未出刀,挂个毛树' else: nowdata['dao']['qq'] = 0 # print(nowdata['tree']) From c42370cc34f43e35d504518150a49fdd946a2214 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:34:00 +0800 Subject: [PATCH 37/78] fix pcr --- worker/pcr.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 8b36df5..7404943 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -204,8 +204,12 @@ class Ans(StdAns): if cmd == '查刀': alldao = '' - for value in nowdata['all_player'].values(): - alldao = alldao + value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + '\n' + for key, value in nowdata['all_player'].items(): + alldao = alldao + value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + if int(key) in nowdata['tree']: + alldao = alldao + ' 在🌳上\n' + else: + alldao = alldao + '\n' return alldao From e1e64eee5371e3f44149ebfdf4fe5da52357a292 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 17:50:23 +0800 Subject: [PATCH 38/78] fix pcr --- worker/pcr.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 7404943..ffa3ef4 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -1,7 +1,7 @@ import json from zzcore import StdAns -AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化'] +AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化','求助'] status = { 'all_player':{ @@ -136,7 +136,8 @@ class Ans(StdAns): nowplayer = nowdata['all_player'][str(self.uid)] except: return '您未登记。' - + if nowdata['dao']['qq'] != self.uid: + return '您未出刀,报个毛刀' try: jianhp = int(self.parms[2]) except: @@ -212,6 +213,11 @@ class Ans(StdAns): alldao = alldao + '\n' return alldao + if cmd == '求助': + on_tree_players = '' + for p in nowdata['tree']: + on_tree_players = on_tree_players + nowdata['all_player'][str(p)]['id'] + '\n' + return '救命[CQ:at,qq=3178302597][CQ:at,qq=3430357110]\n' + on_tree_players + '都在🌳上' From 5c008e9d3aaa9bff04eb099d520be9a2d680ceba Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 18:09:37 +0800 Subject: [PATCH 39/78] fix pcr --- worker/pcr.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index ffa3ef4..cb681d0 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -115,6 +115,10 @@ class Ans(StdAns): nowplayer = nowdata['all_player'][str(self.uid)] except: return '您未登记。' + + if self.uid in nowdata['tree']: + return '您在树上了。' + daoqq = nowdata['dao']['qq'] if daoqq != 0 and daoqq not in nowdata['tree']: return nowdata['all_player'][str(daoqq)]['id'] + '正在出刀,请等待他结算或挂树.' @@ -136,7 +140,11 @@ class Ans(StdAns): nowplayer = nowdata['all_player'][str(self.uid)] except: return '您未登记。' - if nowdata['dao']['qq'] != self.uid: + + if s: + + + if nowdata['dao']['qq'] != self.uid and self.uid not in nowdata['tree']: return '您未出刀,报个毛刀' try: jianhp = int(self.parms[2]) @@ -154,9 +162,13 @@ class Ans(StdAns): nowplayer['余刀'] = nowplayer['余刀'] - 1 nowdata['all_player'][str(self.uid)] = nowplayer + if self.uid in nowdata['tree']: + nowdata.['tree'].remove(self.uid) self.DATASET({'data':json.dumps(nowdata)}) - return nowplayer['id'] + '打了' + bossname(int(nowdata['boss_num'])) + str(jianhp) + '\n剩余血量:' + str(nowdata['boss_hp']) + msg = nowplayer['id'] + '打了' + bossname(int(nowdata['boss_num'])) + str(jianhp) + '\n剩余血量:' + str(nowdata['boss_hp']) + if self.uid in nowdata['tree']: + msg = msg + '\n' + nowplayer['id'] + '自行下树' #BOSS 死了 else: nowdata['boss_hp'] = 0 @@ -170,6 +182,8 @@ class Ans(StdAns): nowplayer['加时刀'] = 1 nowdata['all_player'][str(self.uid)] = nowplayer + if self.uid in nowdata['tree']: + nowdata.['tree'].remove(self.uid) self.DATASET({'data':json.dumps(nowdata)}) return nowplayer['id'] + '击杀了' + bossname(int(nowdata['boss_num'])-1) + '\n现在进入' + bossname(int(nowdata['boss_num'])) + '\n挂树的同学已经全部下树\n请使用\n /pcr 血量 xxxx \n 来设置新Boss的总血量' From bf5403caf7a5b20227ebe183aec5eecf91b2e574 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 18:14:43 +0800 Subject: [PATCH 40/78] fix pcr --- worker/pcr.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index cb681d0..e5af2a4 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -140,10 +140,6 @@ class Ans(StdAns): nowplayer = nowdata['all_player'][str(self.uid)] except: return '您未登记。' - - if s: - - if nowdata['dao']['qq'] != self.uid and self.uid not in nowdata['tree']: return '您未出刀,报个毛刀' try: @@ -163,7 +159,7 @@ class Ans(StdAns): nowdata['all_player'][str(self.uid)] = nowplayer if self.uid in nowdata['tree']: - nowdata.['tree'].remove(self.uid) + nowdata['tree'].remove(self.uid) self.DATASET({'data':json.dumps(nowdata)}) msg = nowplayer['id'] + '打了' + bossname(int(nowdata['boss_num'])) + str(jianhp) + '\n剩余血量:' + str(nowdata['boss_hp']) @@ -183,7 +179,7 @@ class Ans(StdAns): nowdata['all_player'][str(self.uid)] = nowplayer if self.uid in nowdata['tree']: - nowdata.['tree'].remove(self.uid) + nowdata['tree'].remove(self.uid) self.DATASET({'data':json.dumps(nowdata)}) return nowplayer['id'] + '击杀了' + bossname(int(nowdata['boss_num'])-1) + '\n现在进入' + bossname(int(nowdata['boss_num'])) + '\n挂树的同学已经全部下树\n请使用\n /pcr 血量 xxxx \n 来设置新Boss的总血量' From 6a2d7b652ebac27f173e39096b46449ede6f60c5 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 30 Apr 2020 18:17:04 +0800 Subject: [PATCH 41/78] fix pcr --- worker/pcr.py | 1 + 1 file changed, 1 insertion(+) diff --git a/worker/pcr.py b/worker/pcr.py index e5af2a4..a21f6c8 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -165,6 +165,7 @@ class Ans(StdAns): msg = nowplayer['id'] + '打了' + bossname(int(nowdata['boss_num'])) + str(jianhp) + '\n剩余血量:' + str(nowdata['boss_hp']) if self.uid in nowdata['tree']: msg = msg + '\n' + nowplayer['id'] + '自行下树' + return msg #BOSS 死了 else: nowdata['boss_hp'] = 0 From b42aeeb746991845d800c952fce663d2c1589582 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Wed, 6 May 2020 16:05:27 +0800 Subject: [PATCH 42/78] fix pcr --- worker/pcr.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index a21f6c8..eab3556 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -216,12 +216,14 @@ class Ans(StdAns): if cmd == '查刀': alldao = '' + index = 1 for key, value in nowdata['all_player'].items(): - alldao = alldao + value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] + alldao = alldao + str(index) + '. ' + value['id'] + ' ' + '🔪'*value['余刀'] + '🍴'*value['加时刀'] if int(key) in nowdata['tree']: alldao = alldao + ' 在🌳上\n' else: alldao = alldao + '\n' + index = index + 1 return alldao if cmd == '求助': From 076f6a0133403f2aa5c04ccd7965af8d56cce222 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 7 May 2020 17:42:46 +0800 Subject: [PATCH 43/78] duo gonghui pcr --- worker/pcr.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index eab3556..a0e5d6f 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -1,7 +1,7 @@ import json from zzcore import StdAns -AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化','求助'] +AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化','求助','迁移'] status = { 'all_player':{ @@ -32,9 +32,20 @@ class Ans(StdAns): if cmd not in AllowCMD: return '没有 ' + cmd + ' 这个命令,请检查。' - + if cmd == '迁移': + if self.uid != 1318000868: + return '迁移数据请联系SiHuan' + try: + nowdata = json.loads(self.DATAGET()[self.parms[2]]) + except: + return '获取原始数据出错!' + self.DATASET({self.parms[2]:json.dumps(nowdata)}) + return '数据迁移完成! ' + self.parms[1] + '现在迁移到' + self.parms[2] + + gid = str(self.gid) + try: - nowdata = json.loads(self.DATAGET()['data']) + nowdata = json.loads(self.DATAGET()[gid]) except: if cmd == '初始化': nowdata = {} @@ -60,7 +71,7 @@ class Ans(StdAns): '类型':'普通刀', } nowdata['tree'] = [] - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return '初始化完成!请使用\n /pcr 血量 xxxx \n 来设置第一周目第一个Boss的总血量。' if cmd == '登记': @@ -74,7 +85,7 @@ class Ans(StdAns): } nowdata['all_player'][str(self.uid)] = player - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return '[CQ:at,qq=' + str(self.uid) + ']' + '游戏id设置为 ' + nickname @@ -91,7 +102,7 @@ class Ans(StdAns): return '血量应该是整数!' nowdata['boss_hp'] = hp - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return '现在' + bossname(int(nowdata['boss_num'])) +'的血量被设置为' + str(hp) if cmd == '新的一天': @@ -103,7 +114,7 @@ class Ans(StdAns): value['加时刀'] = 0 # value['SL'] == 1 nowdata['tree'] = [] - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return '新的一天已经开始,大家各有3刀剩余了。' @@ -131,7 +142,7 @@ class Ans(StdAns): else: nowdata['dao']['类型'] = '普通刀' - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return nowplayer['id'] + '出' + nowdata['dao']['类型'] + '讨伐' + bossname(int(nowdata['boss_num'])) + '\n剩余血量:' + str(nowdata['boss_hp']) @@ -160,7 +171,7 @@ class Ans(StdAns): nowdata['all_player'][str(self.uid)] = nowplayer if self.uid in nowdata['tree']: nowdata['tree'].remove(self.uid) - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) msg = nowplayer['id'] + '打了' + bossname(int(nowdata['boss_num'])) + str(jianhp) + '\n剩余血量:' + str(nowdata['boss_hp']) if self.uid in nowdata['tree']: @@ -181,7 +192,7 @@ class Ans(StdAns): nowdata['all_player'][str(self.uid)] = nowplayer if self.uid in nowdata['tree']: nowdata['tree'].remove(self.uid) - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return nowplayer['id'] + '击杀了' + bossname(int(nowdata['boss_num'])-1) + '\n现在进入' + bossname(int(nowdata['boss_num'])) + '\n挂树的同学已经全部下树\n请使用\n /pcr 血量 xxxx \n 来设置新Boss的总血量' @@ -205,7 +216,7 @@ class Ans(StdAns): nowdata['tree'].append(self.uid) # print(nowdata['tree']) # print(type(nowdata['tree'])) - self.DATASET({'data':json.dumps(nowdata)}) + self.DATASET({gid:json.dumps(nowdata)}) return '已挂树' if cmd == '查树': From 4ad1dc1dde91071b06314d3b13db663ff935ad4e Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 7 May 2020 17:44:04 +0800 Subject: [PATCH 44/78] duo gonghui pcr --- worker/pcr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index a0e5d6f..8e23514 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -39,8 +39,8 @@ class Ans(StdAns): nowdata = json.loads(self.DATAGET()[self.parms[2]]) except: return '获取原始数据出错!' - self.DATASET({self.parms[2]:json.dumps(nowdata)}) - return '数据迁移完成! ' + self.parms[1] + '现在迁移到' + self.parms[2] + self.DATASET({self.parms[3]:json.dumps(nowdata)}) + return '数据迁移完成! ' + self.parms[2] + '现在迁移到' + self.parms[3] gid = str(self.gid) From beae1b1446948c102a3a5560db1aae6d376608cc Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 7 May 2020 19:59:46 +0800 Subject: [PATCH 45/78] add tiren --- worker/pcr.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index 8e23514..9a247db 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -1,7 +1,7 @@ import json from zzcore import StdAns -AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化','求助','迁移'] +AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化','求助','迁移','踢人'] status = { 'all_player':{ @@ -92,6 +92,25 @@ class Ans(StdAns): else: return '登记失败,请使用合法的游戏id。' + if cmd == '踢人': + if self.role not in ['owner','admin'] and self.uid != 1318000868: + return '你没有权限踢人。' + else: + tiqq = self.parms[2] + try: + nowplayer = nowdata['all_player'][tiqq] + except: + return '此人未登记!!!。' + + if tiqq in nowdata['tree']: + nowdata['tree'].remove(tiqq) + if str(nowdata['dao']['qq']) == tiqq: + nowdata['dao']['qq'] = 0 + + del nowdata['all_player'][tiqq] + self.DATASET({gid: json.dumps(nowdata)}) + return nowplayer['id'] + '已被踢除。' + if cmd == '血量': if self.role not in ['owner','admin'] and self.uid != 1318000868: return '你没有权限设置血量。' From b25ac4f39076fb8b8fe996655a05dc399cf14ccf Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 7 May 2020 20:25:32 +0800 Subject: [PATCH 46/78] add THBwiki group pixiv pcr --- worker/pcr.py | 2 +- worker/pixiv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 9a247db..8a6bebf 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -22,7 +22,7 @@ status = { } class Ans(StdAns): - AllowGroup = [125733077] + AllowGroup = [125733077,1084566280] def GETMSG(self): if len(self.parms) < 2: diff --git a/worker/pixiv.py b/worker/pixiv.py index acab7f2..b1e01fb 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From b26178fb4cdceb2df74a1be7f301c0eb272a0bc4 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 8 May 2020 18:08:37 +0800 Subject: [PATCH 47/78] add dafenshu group pixiv pcr --- worker/pcr.py | 2 +- worker/pixiv.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pcr.py b/worker/pcr.py index 8a6bebf..9b0ddd4 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -22,7 +22,7 @@ status = { } class Ans(StdAns): - AllowGroup = [125733077,1084566280] + AllowGroup = [125733077,1084566280,920863253] def GETMSG(self): if len(self.parms) < 2: diff --git a/worker/pixiv.py b/worker/pixiv.py index b1e01fb..e435d1e 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 0d05b040625578f6ab24fae7e7e5717be5f5541f Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 8 May 2020 22:21:47 +0800 Subject: [PATCH 48/78] adel THBwiki group pixiv --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index e435d1e..2c44fed 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253] + AllowGroup = [805197917,959613860,343700338,125733077,920863253] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From da869e419a5c02b8ba93614bbeddfa093bc32d29 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Fri, 8 May 2020 22:30:14 +0800 Subject: [PATCH 49/78] add THBwiki group pixiv --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 2c44fed..e435d1e 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,920863253] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 3d084394d322c68e4a0ba42b910c21f78f1063ba Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 10 May 2020 12:01:32 +0800 Subject: [PATCH 50/78] pixiv use sihuan pximg --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index e435d1e..84aab02 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -27,7 +27,7 @@ class Ans(StdAns): try: resp = requests.get(url=url,params=params).json() picurl = resp['data'][0]['url'] - msg = picurl + msg = picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') except Exception as e: print(e) msg = '咱没查到,也有可能是Pixiv坏掉了' From 4ae4e9b78db669cc0bffedee87f8bf4dbbbe4913 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 10 May 2020 13:09:38 +0800 Subject: [PATCH 51/78] pixiv use cheerfun pximg --- worker/pixiv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 84aab02..aac92dd 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -27,7 +27,8 @@ class Ans(StdAns): try: resp = requests.get(url=url,params=params).json() picurl = resp['data'][0]['url'] - msg = picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') + # msg = picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') + msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev/') except Exception as e: print(e) msg = '咱没查到,也有可能是Pixiv坏掉了' From 6f55fe7d3b5dc4c9d3902cd0be6a9d76ae782af9 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 10 May 2020 13:11:08 +0800 Subject: [PATCH 52/78] pixiv use cheerfun pximg --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index aac92dd..8f668c5 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -28,7 +28,7 @@ class Ans(StdAns): resp = requests.get(url=url,params=params).json() picurl = resp['data'][0]['url'] # msg = picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') - msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev/') + msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev') except Exception as e: print(e) msg = '咱没查到,也有可能是Pixiv坏掉了' From 5709ba0e39ea89a96a231d9fd40a851b04e81221 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 10 May 2020 13:13:15 +0800 Subject: [PATCH 53/78] pixiv use cheerfun pximg --- worker/pixiv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 8f668c5..3719250 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -27,8 +27,8 @@ class Ans(StdAns): try: resp = requests.get(url=url,params=params).json() picurl = resp['data'][0]['url'] - # msg = picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') - msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev') + msg = picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') + # msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev') except Exception as e: print(e) msg = '咱没查到,也有可能是Pixiv坏掉了' From ae688a3402698f948d6d156018ea54f1383c7cdd Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 10 May 2020 18:58:05 +0800 Subject: [PATCH 54/78] pcr add boss --- worker/pcr.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/worker/pcr.py b/worker/pcr.py index 9b0ddd4..b63e893 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -1,7 +1,7 @@ import json from zzcore import StdAns -AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','初始化','求助','迁移','踢人'] +AllowCMD = ['登记','申请出刀','报刀','挂树','查树','进度','查刀','新的一天','血量','boss','初始化','求助','迁移','踢人'] status = { 'all_player':{ @@ -124,6 +124,19 @@ class Ans(StdAns): self.DATASET({gid:json.dumps(nowdata)}) return '现在' + bossname(int(nowdata['boss_num'])) +'的血量被设置为' + str(hp) + if cmd == 'boss': + if self.role not in ['owner','admin'] and self.uid != 1318000868: + return '你没有权限设置boss。' + else: + try: + boss = int(self.parms[2]) + except: + return 'boss序号应该是整数!' + + nowdata['boss_num'] = boss + self.DATASET({gid:json.dumps(nowdata)}) + return '现在boss被设置为' + bossname(int(nowdata['boss_num'])) + if cmd == '新的一天': if self.role not in ['owner','admin'] and self.uid != 1318000868: return '你没有权限新的一天。' From 638ef3de634f244ac3abba935a7e9483d02da8c8 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 18 May 2020 13:26:38 +0800 Subject: [PATCH 55/78] pixiv jjc group --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 3719250..7021937 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 41989fc922f48fe0e6a451e2acdbd83f2d75fcea Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 19 May 2020 16:18:26 +0800 Subject: [PATCH 56/78] pixiv mirai group --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 7021937..d9b64e9 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From bd4d617f10492bcc60b0ffc346373e8e8403e9dc Mon Sep 17 00:00:00 2001 From: SiHuan Date: Mon, 25 May 2020 15:25:10 +0800 Subject: [PATCH 57/78] pixiv mirai group --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index d9b64e9..e76b0c8 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From c788b0481dcaeecba1bf157787ab876b80dbba1a Mon Sep 17 00:00:00 2001 From: Si-Huan <49349784+Si-Huan@users.noreply.github.com> Date: Mon, 1 Jun 2020 22:50:52 +0800 Subject: [PATCH 58/78] Update mc.py --- worker/mc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/mc.py b/worker/mc.py index 1870cea..0bd3568 100644 --- a/worker/mc.py +++ b/worker/mc.py @@ -3,7 +3,7 @@ import re from subprocess import getoutput,call class Ans(StdAns): - AllowGroup = [959613860] + AllowGroup = [959613860, 125733077] def GETMSG(self): if len(self.parms) < 2: return '不加参数是坏文明!' @@ -47,4 +47,4 @@ class Ans(StdAns): else: msg = '汝是不是在mc后面添加了奇怪的参数,咱可只知道 status list 和 say。' - return msg \ No newline at end of file + return msg From 2bba704dd8c45e65bf3c2946e234bebb4fed86f7 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 18 Jun 2020 19:25:32 +0800 Subject: [PATCH 59/78] update emmm --- route.py | 14 +++++++++----- worker/emmm.py | 9 ++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/route.py b/route.py index 20c1b3e..02c5adb 100644 --- a/route.py +++ b/route.py @@ -1,23 +1,27 @@ from worker import emmm + def ZZRouter(data): uid = data['user_id'] gid = data['group_id'] role = data['sender']['role'] parms = str.split(data['message'][1:]) - print(uid,gid,role,parms) + print(uid, gid, role, parms) if parms == []: parms[0] = 'help' worker = parms[0] try: - package = __import__(name='worker.'+ worker, fromlist=worker) - Ans_ = getattr(package,'Ans') + package = __import__(name='worker.' + worker, fromlist=worker) + Ans_ = getattr(package, 'Ans') except: Ans_ = emmm.Ans - Ans = Ans_(parms,uid,gid,role,data) + Ans = Ans_(parms, uid, gid, role, data) Message = Ans.CheckPermission() if Message == 0: Message = Ans.GETMSG() - Ans.sendmsg(Message) \ No newline at end of file + elif Message == -1: + pass + else: + Ans.sendmsg(Message) diff --git a/worker/emmm.py b/worker/emmm.py index 8a470bd..d15ddec 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -1,8 +1,15 @@ from zzcore import StdAns + class Ans(StdAns): + NotAllowGroup = [204097403] + + def CheckPermission(self): + if self.gid not in self.NotAllowGroup: + return -1 + def GETMSG(self): if self.parms: return '咱也不知道' + self.parms[0] + '是啥呢~' else: - return '汝再调戏咱,咱可就生气了!!' \ No newline at end of file + return '汝再调戏咱,咱可就生气了!!' From 487c3696a5302b5b05f9aef6ffc64bdeafa3ec74 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 18 Jun 2020 19:35:09 +0800 Subject: [PATCH 60/78] fix bug --- route.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/route.py b/route.py index 02c5adb..43fb494 100644 --- a/route.py +++ b/route.py @@ -22,6 +22,5 @@ def ZZRouter(data): if Message == 0: Message = Ans.GETMSG() elif Message == -1: - pass - else: - Ans.sendmsg(Message) + return + Ans.sendmsg(Message) From fb1e70d5d59faa8a29d512143d0bf2b5e63af6cf Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sat, 20 Jun 2020 15:35:23 +0800 Subject: [PATCH 61/78] update emmm --- worker/emmm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker/emmm.py b/worker/emmm.py index d15ddec..04d2d10 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -5,8 +5,9 @@ class Ans(StdAns): NotAllowGroup = [204097403] def CheckPermission(self): - if self.gid not in self.NotAllowGroup: + if self.gid in self.NotAllowGroup: return -1 + return 0 def GETMSG(self): if self.parms: From 219923f30dab0788676dde7a950d5d100bff46bc Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 25 Jun 2020 11:19:04 +0800 Subject: [PATCH 62/78] add archcnqq mc --- worker/mc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/mc.py b/worker/mc.py index 0bd3568..c789289 100644 --- a/worker/mc.py +++ b/worker/mc.py @@ -3,7 +3,7 @@ import re from subprocess import getoutput,call class Ans(StdAns): - AllowGroup = [959613860, 125733077] + AllowGroup = [959613860, 125733077, 204097403] def GETMSG(self): if len(self.parms) < 2: return '不加参数是坏文明!' From 1ca60dbd4cd0ee2e48a78e4d7252f3eb38612ca2 Mon Sep 17 00:00:00 2001 From: SiHuan <49349784+Si-Huan@users.noreply.github.com> Date: Thu, 25 Jun 2020 19:15:16 +0800 Subject: [PATCH 63/78] Update pixiv.py --- worker/pixiv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index e76b0c8..8ddfdfd 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { @@ -32,4 +32,4 @@ class Ans(StdAns): except Exception as e: print(e) msg = '咱没查到,也有可能是Pixiv坏掉了' - return msg \ No newline at end of file + return msg From ab475b483ac9cb8e1b4aa107c80af10dc3809d88 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 28 Jun 2020 12:38:59 +0800 Subject: [PATCH 64/78] add dots group pixiv --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index e76b0c8..4892745 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763,474907856] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 74aecaf53b11082b88f28b804a626cd329d111a6 Mon Sep 17 00:00:00 2001 From: SiHuan <49349784+Si-Huan@users.noreply.github.com> Date: Thu, 9 Jul 2020 10:45:41 +0800 Subject: [PATCH 65/78] pixiv add 247022495 --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 8ddfdfd..8e40ba9 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403] + AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403, 247022495] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From c12d90cc8c25c617fa623c7c61fbff1200e777dd Mon Sep 17 00:00:00 2001 From: SiHuan <49349784+Si-Huan@users.noreply.github.com> Date: Thu, 9 Jul 2020 10:49:39 +0800 Subject: [PATCH 66/78] del pixiv sdustlug --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 8e40ba9..32da47d 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,959613860,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403, 247022495] + AllowGroup = [805197917,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403, 247022495] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From a0804b6578f2b928360cc9f28178ba698f5b28db Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sat, 11 Jul 2020 22:43:42 +0800 Subject: [PATCH 67/78] update pixiv --- worker/pixiv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 736127b..915ba6b 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -27,9 +27,10 @@ class Ans(StdAns): try: resp = requests.get(url=url,params=params).json() picurl = resp['data'][0]['url'] - msg = '[CQ:at,qq=' + str(self.uid) + ']' + '咱帮你🔍 ' + keyword + ' 到了这个\n' + picurl.replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') + msg = '[CQ:at,qq=' + str(self.uid) + ']' + '咱帮你🔍 ' + keyword + ' 找到了这个\n' + picurl + # .replace('https://i.pixiv.cat', 'https://pximg.sihuan.workers.dev') # msg = picurl.replace('https://i.pixiv.cat', 'https://original.img.cheerfun.dev') except Exception as e: print(e) - msg = '[CQ:at,qq=' + str(self.uid) + ']咱没查到' + keyword + '也有可能是Pixiv坏掉了' + msg = '[CQ:at,qq=' + str(self.uid) + ']咱没查到 ' + keyword + ' 也有可能是Pixiv坏掉了' return msg From 4d77531ff578164dedf329672bf8fd5904b5c020 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 12 Jul 2020 22:41:00 +0800 Subject: [PATCH 68/78] pixiv add erchiyuan froup --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 915ba6b..888e558 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -4,7 +4,7 @@ import requests from config import LOLIKEY class Ans(StdAns): - AllowGroup = [805197917,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403, 247022495, 474907856] + AllowGroup = [973510746, 805197917,343700338,125733077,1084566280,920863253,798595664,655057127,196268763, 204097403, 247022495, 474907856] def GETMSG(self): url = 'https://api.lolicon.app/setu/' params = { From 8518296c6cf1ed382a8273e50e27fe6075375307 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 12 Jul 2020 23:19:40 +0800 Subject: [PATCH 69/78] pixiv no sakuya --- worker/pixiv.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/worker/pixiv.py b/worker/pixiv.py index 888e558..5320581 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -23,6 +23,8 @@ class Ans(StdAns): else: keyword = self.raw_msg['message'][7:] + if keyword in ['十六夜咲夜','十六夜','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + return "不许看咲夜的涩图!!" params['keyword'] = keyword try: resp = requests.get(url=url,params=params).json() From b04c8453e555f364331129a4773726427af3ea76 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Sun, 12 Jul 2020 23:23:05 +0800 Subject: [PATCH 70/78] pixiv no sakuya --- worker/pixiv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/pixiv.py b/worker/pixiv.py index 5320581..cebc613 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -23,7 +23,7 @@ class Ans(StdAns): else: keyword = self.raw_msg['message'][7:] - if keyword in ['十六夜咲夜','十六夜','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + if keyword in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: return "不许看咲夜的涩图!!" params['keyword'] = keyword try: From 27f3270f87afc7d5d7a9944b166c51baefa26c74 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 16:44:26 +0800 Subject: [PATCH 71/78] only my sakuya --- worker/echo.py | 6 ++++++ worker/emmm.py | 4 ++++ worker/pixiv.py | 6 ++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/worker/echo.py b/worker/echo.py index 04db737..49d4161 100644 --- a/worker/echo.py +++ b/worker/echo.py @@ -5,6 +5,12 @@ class Ans(StdAns): def GETMSG(self): if len(self.parms) < 2: return '不加参数是坏文明!' + + if self.uid != 1318000868: + for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + if sakuya in keyword: + return "不许你们说咲夜!!" + r = random.randint(1,3) if r == 1: msg = self.raw_msg['message'][6:] diff --git a/worker/emmm.py b/worker/emmm.py index 04d2d10..d461b49 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -11,6 +11,10 @@ class Ans(StdAns): def GETMSG(self): if self.parms: + if self.uid != 1318000868: + for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + if sakuya in self.parms[0]: + return "咲夜是最完美的!!" return '咱也不知道' + self.parms[0] + '是啥呢~' else: return '汝再调戏咱,咱可就生气了!!' diff --git a/worker/pixiv.py b/worker/pixiv.py index cebc613..9e71e50 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -23,8 +23,10 @@ class Ans(StdAns): else: keyword = self.raw_msg['message'][7:] - if keyword in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: - return "不许看咲夜的涩图!!" + if self.uid != 1318000868: + for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + if sakuya in keyword: + return "不许你们看咲夜的涩图!!" params['keyword'] = keyword try: resp = requests.get(url=url,params=params).json() From 5af53ef2c3abe3c59949e2e77743bb87caf01de9 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 16:45:22 +0800 Subject: [PATCH 72/78] fix echo --- worker/echo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/echo.py b/worker/echo.py index 49d4161..3486136 100644 --- a/worker/echo.py +++ b/worker/echo.py @@ -8,7 +8,7 @@ class Ans(StdAns): if self.uid != 1318000868: for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: - if sakuya in keyword: + if sakuya in self.raw_msg['message']: return "不许你们说咲夜!!" r = random.randint(1,3) From 2425a50d31d7907a55decd9dcfa14d18c0b833bb Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 16:49:15 +0800 Subject: [PATCH 73/78] =?UTF-8?q?add=20=E5=8F=A3=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worker/echo.py | 2 +- worker/emmm.py | 2 +- worker/pixiv.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/worker/echo.py b/worker/echo.py index 3486136..7cbebcc 100644 --- a/worker/echo.py +++ b/worker/echo.py @@ -7,7 +7,7 @@ class Ans(StdAns): return '不加参数是坏文明!' if self.uid != 1318000868: - for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if sakuya in self.raw_msg['message']: return "不许你们说咲夜!!" diff --git a/worker/emmm.py b/worker/emmm.py index d461b49..491a8b6 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -12,7 +12,7 @@ class Ans(StdAns): def GETMSG(self): if self.parms: if self.uid != 1318000868: - for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if sakuya in self.parms[0]: return "咲夜是最完美的!!" return '咱也不知道' + self.parms[0] + '是啥呢~' diff --git a/worker/pixiv.py b/worker/pixiv.py index 9e71e50..caa4511 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -24,7 +24,7 @@ class Ans(StdAns): else: keyword = self.raw_msg['message'][7:] if self.uid != 1318000868: - for sakuya in ['十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if sakuya in keyword: return "不许你们看咲夜的涩图!!" params['keyword'] = keyword From df26a0d62413676e90098438dcfdaabbdc8c9e0b Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 17:04:09 +0800 Subject: [PATCH 74/78] update mysakyta --- worker/echo.py | 10 ++++------ worker/emmm.py | 10 +++++----- worker/pixiv.py | 10 +++++----- zzcore.py | 13 ++++++++++++- 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/worker/echo.py b/worker/echo.py index 7cbebcc..4ac5437 100644 --- a/worker/echo.py +++ b/worker/echo.py @@ -1,15 +1,13 @@ import random -from zzcore import StdAns +from zzcore import StdAns, mysakuya class Ans(StdAns): def GETMSG(self): if len(self.parms) < 2: return '不加参数是坏文明!' - - if self.uid != 1318000868: - for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: - if sakuya in self.raw_msg['message']: - return "不许你们说咲夜!!" + + if mysakuya(self,self.raw_msg['message']) == False: + return "不许你们说咲夜!!" r = random.randint(1,3) if r == 1: diff --git a/worker/emmm.py b/worker/emmm.py index 491a8b6..e591451 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -1,4 +1,4 @@ -from zzcore import StdAns +from zzcore import StdAns, mysakuya class Ans(StdAns): @@ -11,10 +11,10 @@ class Ans(StdAns): def GETMSG(self): if self.parms: - if self.uid != 1318000868: - for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: - if sakuya in self.parms[0]: - return "咲夜是最完美的!!" + + if mysakuya(self, self.parms[0]) == False: + return "咲夜是最完美的!!" + return '咱也不知道' + self.parms[0] + '是啥呢~' else: return '汝再调戏咱,咱可就生气了!!' diff --git a/worker/pixiv.py b/worker/pixiv.py index caa4511..b376309 100644 --- a/worker/pixiv.py +++ b/worker/pixiv.py @@ -1,4 +1,4 @@ -from zzcore import StdAns +from zzcore import StdAns, mysakuya import requests from config import LOLIKEY @@ -23,10 +23,10 @@ class Ans(StdAns): else: keyword = self.raw_msg['message'][7:] - if self.uid != 1318000868: - for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: - if sakuya in keyword: - return "不许你们看咲夜的涩图!!" + + if mysakuya(self, keyword) == False: + return "不许你们看咲夜的涩图!!" + params['keyword'] = keyword try: resp = requests.get(url=url,params=params).json() diff --git a/zzcore.py b/zzcore.py index 1f37c15..8138e59 100644 --- a/zzcore.py +++ b/zzcore.py @@ -61,4 +61,15 @@ class StdAns(): data = { 'message_id' : msgid, } - requests.post(url = url, data = json.dumps(data),headers = Headers) \ No newline at end of file + requests.post(url = url, data = json.dumps(data),headers = Headers) + + +def mysakuya(self, words): + if self.uid == 1318000868: + return True + + if ('咲' in words and '夜' in words) or ('口关' in words and '夜' in words) or ('十' in words and '六' in words and '夜' in words) or ('1' in words and '6' in words and '夜' in words): + return False + for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: + if sakuya in words: + return False \ No newline at end of file From 0a64039ddd62e66bca121c59672d60c96d7866a1 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 17:11:33 +0800 Subject: [PATCH 75/78] update emmm mysakuya --- worker/emmm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/emmm.py b/worker/emmm.py index e591451..d327b83 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -12,7 +12,7 @@ class Ans(StdAns): def GETMSG(self): if self.parms: - if mysakuya(self, self.parms[0]) == False: + if mysakuya(self, self.raw_msg['message']) == False: return "咲夜是最完美的!!" return '咱也不知道' + self.parms[0] + '是啥呢~' From e823e093fc3dd27b23dc6041e00ecb06e7f8e548 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 17:17:18 +0800 Subject: [PATCH 76/78] update mysakuya --- zzcore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zzcore.py b/zzcore.py index 8138e59..c51dd81 100644 --- a/zzcore.py +++ b/zzcore.py @@ -68,7 +68,7 @@ def mysakuya(self, words): if self.uid == 1318000868: return True - if ('咲' in words and '夜' in words) or ('口关' in words and '夜' in words) or ('十' in words and '六' in words and '夜' in words) or ('1' in words and '6' in words and '夜' in words): + if ('咲' in words and '夜' in words) or ('关' in words and '夜' in words) or ('十' in words and '六' in words and '夜' in words) or ('1' in words and '6' in words and '夜' in words): return False for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if sakuya in words: From 0076a34dffc1628d63566812cbf15d3bd440e6c0 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Tue, 14 Jul 2020 17:23:11 +0800 Subject: [PATCH 77/78] update zzcore mysakuya --- zzcore.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zzcore.py b/zzcore.py index c51dd81..c70562b 100644 --- a/zzcore.py +++ b/zzcore.py @@ -72,4 +72,6 @@ def mysakuya(self, words): return False for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if sakuya in words: - return False \ No newline at end of file + return False + + return True \ No newline at end of file From d789c58ab15e397fa102c2f45b39bbf2e7856d28 Mon Sep 17 00:00:00 2001 From: SiHuan <49349784+Si-Huan@users.noreply.github.com> Date: Wed, 15 Jul 2020 19:43:33 +0800 Subject: [PATCH 78/78] add uos peixun group --- worker/mc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worker/mc.py b/worker/mc.py index c789289..7970eb9 100644 --- a/worker/mc.py +++ b/worker/mc.py @@ -3,7 +3,7 @@ import re from subprocess import getoutput,call class Ans(StdAns): - AllowGroup = [959613860, 125733077, 204097403] + AllowGroup = [959613860, 125733077, 204097403, 1140391080] def GETMSG(self): if len(self.parms) < 2: return '不加参数是坏文明!'