update mysakyta

This commit is contained in:
SiHuan 2020-07-14 17:04:09 +08:00
parent 2425a50d31
commit df26a0d624
4 changed files with 26 additions and 17 deletions

View file

@ -1,15 +1,13 @@
import random import random
from zzcore import StdAns from zzcore import StdAns, mysakuya
class Ans(StdAns): class Ans(StdAns):
def GETMSG(self): def GETMSG(self):
if len(self.parms) < 2: if len(self.parms) < 2:
return '不加参数是坏文明!' return '不加参数是坏文明!'
if self.uid != 1318000868: if mysakuya(self,self.raw_msg['message']) == False:
for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: return "不许你们说咲夜!!"
if sakuya in self.raw_msg['message']:
return "不许你们说咲夜!!"
r = random.randint(1,3) r = random.randint(1,3)
if r == 1: if r == 1:

View file

@ -1,4 +1,4 @@
from zzcore import StdAns from zzcore import StdAns, mysakuya
class Ans(StdAns): class Ans(StdAns):
@ -11,10 +11,10 @@ class Ans(StdAns):
def GETMSG(self): def GETMSG(self):
if self.parms: if self.parms:
if self.uid != 1318000868:
for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if mysakuya(self, self.parms[0]) == False:
if sakuya in self.parms[0]: return "咲夜是最完美的!!"
return "咲夜是最完美的!!"
return '咱也不知道' + self.parms[0] + '是啥呢~' return '咱也不知道' + self.parms[0] + '是啥呢~'
else: else:
return '汝再调戏咱,咱可就生气了!!' return '汝再调戏咱,咱可就生气了!!'

View file

@ -1,4 +1,4 @@
from zzcore import StdAns from zzcore import StdAns, mysakuya
import requests import requests
from config import LOLIKEY from config import LOLIKEY
@ -23,10 +23,10 @@ class Ans(StdAns):
else: else:
keyword = self.raw_msg['message'][7:] keyword = self.raw_msg['message'][7:]
if self.uid != 1318000868:
for sakuya in ['口关夜','十六夜咲夜','十六夜','十六','咲夜','Sakuya','sakuya','Izayoi Sakuya','Izayoi','izayoi','izayoi sakuya']: if mysakuya(self, keyword) == False:
if sakuya in keyword: return "不许你们看咲夜的涩图!!"
return "不许你们看咲夜的涩图!!"
params['keyword'] = keyword params['keyword'] = keyword
try: try:
resp = requests.get(url=url,params=params).json() resp = requests.get(url=url,params=params).json()

View file

@ -62,3 +62,14 @@ class StdAns():
'message_id' : msgid, 'message_id' : msgid,
} }
requests.post(url = url, data = json.dumps(data),headers = Headers) 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