diff --git a/.gitignore b/.gitignore index 1dc8a82..69ed991 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ env __pycache__ .vscode -config.py \ No newline at end of file +config.py +.idea \ No newline at end of file diff --git a/route.py b/route.py index 54fb6de..71ad234 100644 --- a/route.py +++ b/route.py @@ -9,7 +9,8 @@ def ZZRouter(data): gid = data['group_id'] role = data['sender']['role'] parms = str.split(data['message'][1:]) - print(uid, gid, role, parms) + nickname = data['sender']['nickname'] + print(uid, gid, role, parms, nickname) if parms == []: parms[0] = 'help' worker = parms[0] @@ -20,7 +21,7 @@ def ZZRouter(data): except: Ans_ = emmm.Ans - Ans = Ans_(parms, uid, gid, role, data) + Ans = Ans_(parms, uid, gid, role, data, nickname) Message = Ans.CheckPermission() if Message == 0: Message = Ans.GETMSG() diff --git a/worker/pcr.py b/worker/pcr.py index 0c40fb8..f3adcb1 100644 --- a/worker/pcr.py +++ b/worker/pcr.py @@ -320,7 +320,7 @@ class Ans(StdAns): resultStar.append(2) resultName.append(choice(star2)) stones = 0 - colors = '' + colors = '@{}\n'.format(self.nickname) for each in range(len(resultStar)): if resultStar[each] == 3: stones = stones + 50 diff --git a/zzcore.py b/zzcore.py index da88478..af1da0b 100644 --- a/zzcore.py +++ b/zzcore.py @@ -12,12 +12,13 @@ class StdAns(): UserNotAllow = '汝不被允许呢.' RoleNotAllow = '汝的角色不被允许哦.' - def __init__(self,parms,uid,gid,role,raw_msg): + def __init__(self,parms,uid,gid,role,raw_msg,nickname): 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])