diff options
| author | 2018-08-31 12:55:52 +0100 | |
|---|---|---|
| committer | 2018-08-31 12:55:52 +0100 | |
| commit | 9874f79b498e1f8ae5ebec9a240963e908b645b0 (patch) | |
| tree | d5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/stats.py | |
| parent | Merge pull request #7 from dngfx/master (diff) | |
| signature | ||
Give modules event objects with "context"s, to facilitate purging all the event
hooks for a module
Diffstat (limited to 'modules/stats.py')
| -rw-r--r-- | modules/stats.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/stats.py b/modules/stats.py index 09468327..7ba19e43 100644 --- a/modules/stats.py +++ b/modules/stats.py @@ -2,12 +2,12 @@ import time import Utils class Module(object): - def __init__(self, bot): + def __init__(self, bot, events): self.boot_time = time.time() self.bot = bot - bot.events.on("received").on("command").on("uptime" + events.on("received").on("command").on("uptime" ).hook(self.uptime, help="Show my uptime") - bot.events.on("received").on("command").on("stats" + events.on("received").on("command").on("stats" ).hook(self.stats, help="Show my network/channel/user stats") def uptime(self, event): |
