This commit is contained in:
2920233418@qq.com 2020-08-16 19:11:44 +08:00
parent 3b03b7b997
commit ead17a4218
3 changed files with 7 additions and 8 deletions

3
.gitignore vendored
View file

@ -2,4 +2,5 @@ env
__pycache__
.vscode
config.py
.idea
.idea
test.py

View file

@ -9,8 +9,7 @@ def ZZRouter(data):
gid = data['group_id']
role = data['sender']['role']
parms = str.split(data['message'][1:])
nickname = data['sender']['nickname']
print(uid, gid, role, parms, nickname)
print(uid, gid, role, parms)
if parms == []:
parms[0] = 'help'
worker = parms[0]

View file

@ -1,8 +1,8 @@
import requests, json, redis
import requests, json#, redis
from config import APIURL, ALLWORKERS, AUTHORIZATION
from worker import emmm
pool = redis.ConnectionPool(host='127.0.0.1', port=6379, decode_responses=True)
r = redis.Redis(connection_pool=pool)
# pool = redis.ConnectionPool(host='127.0.0.1', port=6379, decode_responses=True)
# r = redis.Redis(connection_pool=pool)
class StdAns():
AllowGroup = []
@ -12,13 +12,12 @@ class StdAns():
UserNotAllow = '汝不被允许呢.'
RoleNotAllow = '汝的角色不被允许哦.'
def __init__(self,parms,uid,gid,role,raw_msg,nickname):
def __init__(self,parms,uid,gid,role,raw_msg):
self.parms = parms
self.uid = uid
self.gid = gid
self.role = role
self.raw_msg = raw_msg
self.nickname = nickname
def DATAGET(self):
return r.hgetall(self.parms[0])