2020-08-04 21:42:24 +08:00
|
|
|
from zzcore import StdAns, mysakuya
|
|
|
|
import requests
|
|
|
|
|
|
|
|
class Ans(StdAns):
|
|
|
|
def GETMSG(self):
|
|
|
|
if len(self.parms) < 2:
|
|
|
|
return '不加参数是坏文明!'
|
|
|
|
|
2021-01-27 11:33:32 +08:00
|
|
|
if mysakuya(self, self.raw_msg['raw_message']) == False:
|
2020-08-04 21:42:24 +08:00
|
|
|
return "不许你们说咲夜!!"
|
|
|
|
|
|
|
|
msg = f"[CQ:reply,id={self.raw_msg['message_id']}]"
|
2020-08-04 21:48:48 +08:00
|
|
|
r = nbnhhsh(self.parms[1])
|
|
|
|
msg += f'''{(str(r['trans'])[1:-1]).replace("'","").replace(","," ")}'''
|
2020-08-04 21:42:24 +08:00
|
|
|
|
|
|
|
return msg
|
|
|
|
|
|
|
|
|
|
|
|
def nbnhhsh(text):
|
|
|
|
url = 'https://lab.magiconch.com/api/nbnhhsh/guess'
|
|
|
|
data = {
|
|
|
|
'text': text,
|
|
|
|
}
|
|
|
|
|
|
|
|
r = requests.post(url=url, data=data).json()
|
2020-08-04 21:48:48 +08:00
|
|
|
return r[0]
|