diff options
| author | 2018-08-10 10:27:34 +0100 | |
|---|---|---|
| committer | 2018-08-10 10:28:24 +0100 | |
| commit | 8d50b702f3c6865eac8a87d0b39a3bd15761039e (patch) | |
| tree | c97051142276d821c6bb87b6f8ee429d1f439aba /modules/coins.py | |
| parent | stderr not stdout, int() interest rates and actually redo interest rates every (diff) | |
| signature | ||
A 10 second interval for interest rates is not good
Diffstat (limited to 'modules/coins.py')
| -rw-r--r-- | modules/coins.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/coins.py b/modules/coins.py index 765ebdc8..550b11e9 100644 --- a/modules/coins.py +++ b/modules/coins.py @@ -5,6 +5,8 @@ SIDES = {"heads": 0, "tails": 1} DEFAULT_REDEEM_DELAY = 600 # 600 seconds, 10 minutes DEFAULT_REDEEM_AMOUNT = 100 DEFAULT_INTEREST_RATE = 0.01 +INTEREST_INTERVAL = 60*60 # 1 hour + class Module(object): def __init__(self, bot): @@ -27,7 +29,7 @@ class Module(object): until_next_hour += ((60-(now.minute+1))*60) bot.events.on("timer").on("coin-interest").hook(self.interest) - bot.add_timer("coin-interest", 10, persist=False, + bot.add_timer("coin-interest", INTEREST_INTERVAL, persist=False, next_due=time.time()+until_next_hour) def coins(self, event): |
