update emmm
This commit is contained in:
parent
bd4d617f10
commit
2bba704dd8
2 changed files with 17 additions and 6 deletions
14
route.py
14
route.py
|
@ -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)
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
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] + '是啥呢~'
|
||||
|
|
Loading…
Reference in a new issue