抽卡@人,class内加入昵称属性。
This commit is contained in:
parent
9525736cf5
commit
3b03b7b997
4 changed files with 8 additions and 5 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
env
|
||||
__pycache__
|
||||
.vscode
|
||||
config.py
|
||||
config.py
|
||||
.idea
|
5
route.py
5
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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue