Fix more issues with referencing "server" in interest() in coins.py

This commit is contained in:
jesopo 2018-08-09 16:13:17 +01:00
parent e477e8f04f
commit 1cc83a4a38

View file

@ -136,12 +136,11 @@ class Module(object):
for server in self.bot.servers.values():
all_coins = server.get_all_user_settings(
"coins", [])
interest_rate = event["server"].get_setting("interest-rate",
interest_rate = server.get_setting("interest-rate",
DEFAULT_INTEREST_RATE)
redeem_amount = event["server"].get_setting("redeem-amount",
redeem_amount = server.get_setting("redeem-amount",
DEFAULT_REDEEM_AMOUNT)
for nickname, coins in all_coins:
if coins > redeem_amount:
coins += coins*interest_rate
event["server"].get_user(nickname).set_setting("coins",
coins)
server.get_user(nickname).set_setting("coins", coins)