Remove unneeded complexity in modules/coins.py.reset_coins

This commit is contained in:
jesopo 2018-10-16 13:43:45 +01:00
parent 7eb65ac1da
commit 1eab3178b3

View file

@ -144,13 +144,9 @@ class Module(ModuleManager.BaseModule):
"""
target = event["server"].get_user(event["args_split"][0])
coins = self._get_user_coins(target)
if coins == DECIMAL_ZERO:
event["stderr"].write("%s already has %s coins" % (
target.nickname, str(DECIMAL_ZERO)))
else:
self._give_to_pool(event["server"], coins)
self._reset_user_coins(target)
event["stdout"].write("Reset coins for %s" % target.nickname)
self._take(event["server"], target, coins)
self._reset_user_coins(target)
event["stdout"].write("Reset coins for %s" % target.nickname)
@utils.hook("received.command.givecoins", min_args=1)
def give_coins(self, event):