Merge pull request #48 from brrr2/fix

Update for showing votes, time and roles.
This commit is contained in:
nyuszika7h 2014-08-10 23:37:23 +02:00
commit 885873701f

View File

@ -796,10 +796,12 @@ def show_votes(cli, nick, chan, rest):
for votee in var.VOTES.keys()] for votee in var.VOTES.keys()]
msg = '{}: {}'.format(nick, ', '.join(votelist)) msg = '{}: {}'.format(nick, ', '.join(votelist))
if chan == nick or nick in pl: if chan == nick:
cli.msg(chan, msg) pm(cli, nick, msg)
else: elif nick not in pl and var.PHASE not in ("none", "join"):
cli.notice(nick, msg) cli.notice(nick, msg)
else:
cli.msg(chan, msg)
pl = var.list_players() pl = var.list_players()
avail = len(pl) - len(var.WOUNDED) avail = len(pl) - len(var.WOUNDED)
@ -808,10 +810,12 @@ def show_votes(cli, nick, chan, rest):
'required to lynch, \u0002{}\u0002 players available to ' 'required to lynch, \u0002{}\u0002 players available to '
'vote.').format(nick, len(pl), votesneeded, avail) 'vote.').format(nick, len(pl), votesneeded, avail)
if chan == nick or nick in pl: if chan == nick:
cli.msg(chan, the_message) pm(cli, nick, the_message)
else: elif nick not in pl and var.PHASE not in ("none", "join"):
cli.notice(nick, the_message) cli.notice(nick, the_message)
else:
cli.msg(chan, the_message)
@pmcmd('votes') @pmcmd('votes')
@ -3023,6 +3027,8 @@ def timeleft(cli, nick, chan, rest):
if nick == chan: if nick == chan:
pm(cli, nick, msg) pm(cli, nick, msg)
elif nick not in var.list_players() and var.PHASE not in ("none", "join"):
cli.notice(nick, msg)
else: else:
cli.msg(chan, msg) cli.msg(chan, msg)
@ -3058,6 +3064,8 @@ def listroles(cli, nick, chan, rest):
old = v old = v
if chan == nick: if chan == nick:
pm(cli, nick, txt) pm(cli, nick, txt)
elif nick not in var.list_players() and var.PHASE not in ("none", "join"):
cli.notice(nick, txt)
else: else:
cli.msg(chan, txt) cli.msg(chan, txt)