From 2bba704dd8c45e65bf3c2946e234bebb4fed86f7 Mon Sep 17 00:00:00 2001 From: SiHuan Date: Thu, 18 Jun 2020 19:25:32 +0800 Subject: [PATCH] update emmm --- route.py | 14 +++++++++----- worker/emmm.py | 9 ++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/route.py b/route.py index 20c1b3e..02c5adb 100644 --- a/route.py +++ b/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) \ No newline at end of file + elif Message == -1: + pass + else: + Ans.sendmsg(Message) diff --git a/worker/emmm.py b/worker/emmm.py index 8a470bd..d15ddec 100644 --- a/worker/emmm.py +++ b/worker/emmm.py @@ -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 '汝再调戏咱,咱可就生气了!!' \ No newline at end of file + return '汝再调戏咱,咱可就生气了!!'