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
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:

View file

@ -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 '汝再调戏咱,咱可就生气了!!'

View file

@ -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()

View file

@ -61,4 +61,15 @@ class StdAns():
data = {
'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