mc list up up up
This commit is contained in:
parent
aa6117f5ba
commit
d906ebacff
1 changed files with 2 additions and 2 deletions
|
@ -12,13 +12,13 @@ class Ans(StdAns):
|
|||
if cmd == 'list':
|
||||
output = getoutput('spigot status')
|
||||
p = re.compile(r'There are (.*?)[ of a max]', re.S)
|
||||
online = int(re.findall(p,a)[0])
|
||||
online = int(re.findall(p,output)[0])
|
||||
if online == 0:
|
||||
msg = '咱看着没有人在线哎\n_(-ω-`_)⌒)_'
|
||||
else:
|
||||
msg = '有' + str(online) + '个小伙伴在线!'
|
||||
p = re.compile(r'online: (.*?)[\n>]', re.S)
|
||||
players = re.findall(p,a)[0].split(', ')
|
||||
players = re.findall(p,output)[0].split(', ')
|
||||
for player in players:
|
||||
msg = msg + '\n' + player
|
||||
return msg
|
||||
|
|
Loading…
Reference in a new issue