Respect !simple for !gstats/!pstats

This commit is contained in:
nyuszika7h 2014-02-21 10:25:53 +01:00
parent d051330b0f
commit 35a7e02f81

View File

@ -2965,7 +2965,10 @@ def game_stats(cli, nick, chan, rest):
# List all games sizes and totals if no size is given. # List all games sizes and totals if no size is given.
if rest == "": if rest == "":
cli.msg(chan, var.get_game_totals()) if chan == nick:
pm(cli, nick, var.get_game_totals())
else:
cli.msg(chan, var.get_game_totals())
return return
# Check for invalid input # Check for invalid input
@ -2975,7 +2978,10 @@ def game_stats(cli, nick, chan, rest):
return return
# Attempt to find game stats for the given game size. # Attempt to find game stats for the given game size.
cli.msg(chan, var.get_game_stats(int(rest))) if chan == nick:
pm(nick, var.get_game_stats(int(rest)))
else:
cli.msg(chan, var.get_game_stats(int(rest)))
@pmcmd("gamestats", "gstats") @pmcmd("gamestats", "gstats")
def game_stats_pm(cli, nick, rest): def game_stats_pm(cli, nick, rest):
@ -3015,11 +3021,17 @@ def player_stats(cli, nick, chan, rest):
# List the player's total games for all roles if no role is given # List the player's total games for all roles if no role is given
if len(params) < 2: if len(params) < 2:
cli.msg(chan, var.get_player_totals(acc)) if chan == nick:
pm(cli, nick, var.get_player_totals(acc))
else:
cli.msg(chan, var.get_player_totals(acc))
else: else:
role = " ".join(params[1:]).lower() role = " ".join(params[1:]).lower()
# Attempt to find the player's stats. # Attempt to find the player's stats.
cli.msg(chan, var.get_player_stats(acc, role)) if chan == nick:
pm(cli, nick, var.get_player_stats(acc, role))
else:
cli.msg(chan, var.get_player_stats(acc, role))
@pmcmd("playerstats", "pstats", "player", "p") @pmcmd("playerstats", "pstats", "player", "p")
def player_stats_pm(cli, nick, rest): def player_stats_pm(cli, nick, rest):