Allow users to see other people's coins
This commit is contained in:
parent
1cc83a4a38
commit
a114390cde
1 changed files with 6 additions and 2 deletions
|
@ -31,9 +31,13 @@ class Module(object):
|
||||||
next_due=time.time()+until_next_hour)
|
next_due=time.time()+until_next_hour)
|
||||||
|
|
||||||
def coins(self, event):
|
def coins(self, event):
|
||||||
coins = event["user"].get_setting("coins", 0)
|
if event["args_split"]:
|
||||||
|
target = event["server"].get_user(event["args_split"][0])
|
||||||
|
else:
|
||||||
|
target = event["user"]
|
||||||
|
coins = target.get_setting("coins", 0)
|
||||||
event["stdout"].write("%s has %d coin%s" % (
|
event["stdout"].write("%s has %d coin%s" % (
|
||||||
event["user"].nickname, coins,
|
target.nickname, coins,
|
||||||
"" if coins == 1 else "s"))
|
"" if coins == 1 else "s"))
|
||||||
|
|
||||||
def richest(self, event):
|
def richest(self, event):
|
||||||
|
|
Loading…
Reference in a new issue