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 from worker import emmm
def ZZRouter(data): def ZZRouter(data):
uid = data['user_id'] uid = data['user_id']
gid = data['group_id'] gid = data['group_id']
role = data['sender']['role'] role = data['sender']['role']
parms = str.split(data['message'][1:]) parms = str.split(data['message'][1:])
print(uid,gid,role,parms) print(uid, gid, role, parms)
if parms == []: if parms == []:
parms[0] = 'help' parms[0] = 'help'
worker = parms[0] worker = parms[0]
try: try:
package = __import__(name='worker.'+ worker, fromlist=worker) package = __import__(name='worker.' + worker, fromlist=worker)
Ans_ = getattr(package,'Ans') Ans_ = getattr(package, 'Ans')
except: except:
Ans_ = emmm.Ans Ans_ = emmm.Ans
Ans = Ans_(parms,uid,gid,role,data) Ans = Ans_(parms, uid, gid, role, data)
Message = Ans.CheckPermission() Message = Ans.CheckPermission()
if Message == 0: if Message == 0:
Message = Ans.GETMSG() Message = Ans.GETMSG()
elif Message == -1:
pass
else:
Ans.sendmsg(Message) Ans.sendmsg(Message)

View file

@ -1,6 +1,13 @@
from zzcore import StdAns from zzcore import StdAns
class Ans(StdAns): class Ans(StdAns):
NotAllowGroup = [204097403]
def CheckPermission(self):
if self.gid not in self.NotAllowGroup:
return -1
def GETMSG(self): def GETMSG(self):
if self.parms: if self.parms:
return '咱也不知道' + self.parms[0] + '是啥呢~' return '咱也不知道' + self.parms[0] + '是啥呢~'