Merge pull request #3 from Si-Huan/master

update data
This commit is contained in:
weilinfox 2020-03-07 18:42:54 +08:00 committed by GitHub
commit f01ae4bdd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,9 +1,15 @@
from zzcore import StdAns
from subprocess import run
from subprocess import check_output
class Ans(StdAns):
def GETMSG(self):
if len(self.parms) < 2:
return '不加参数是坏文明!'
domain = self.raw_msg['message'][4:]
r = run(["nslookup",domain],capture_output=True)
msg = bytes.decode(r.stdout)
return msg
try:
answer = check_output(['nslookup',domain],shell=False,timeout=4)
msg = bytes.decode(answer)
except:
msg = '汝干了什么! ns 超时了!'
return msg