update emmm

This commit is contained in:
SiHuan 2020-06-18 19:25:32 +08:00
parent bd4d617f10
commit 2bba704dd8
2 changed files with 17 additions and 6 deletions

View file

@ -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)
elif Message == -1:
pass
else:
Ans.sendmsg(Message)

View file

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