Skip to content

Commit

Permalink
cron events no longer have timers
Browse files Browse the repository at this point in the history
  • Loading branch information
jesopo committed Dec 13, 2019
1 parent e82f085 commit 8a963b5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def roulette(self, event):

@utils.hook("cron")
@utils.kwarg("schedule", "0 *")
def _interest(self, timer):
def _interest(self, event):
for server in self.bot.servers.values():
if not server.get_setting("coin-interest", False):
continue
Expand All @@ -451,7 +451,6 @@ def _interest(self, timer):
interest = round(coins*interest_rate, 2)
server.set_user_setting(nickname, "coins",
self._coin_str(coins+interest))
timer.redo()

@utils.hook("received.command.lotterybuy", authenticated=True)
def lottery_buy(self, event):
Expand Down Expand Up @@ -536,7 +535,7 @@ def lottery_winner(self, event):

@utils.hook("cron")
@utils.kwarg("schedule", "0 */6")
def _lottery(self, timer):
def _lottery(self, event):
for server in self.bot.servers.values():
lottery = server.get_setting("lottery", {})
if lottery:
Expand All @@ -557,4 +556,3 @@ def _lottery(self, timer):
server.set_setting("lottery-winner", user.nickname)
user.send_notice("You won %s in the lottery! you now have %s coins"
% (self._coin_str(winnings), self._coin_str(new_coins)))
timer.redo()

0 comments on commit 8a963b5

Please sign in to comment.