diff options
| author | 2018-10-12 18:07:23 +0100 | |
|---|---|---|
| committer | 2018-10-12 18:07:23 +0100 | |
| commit | 819f4e0680dc8225355924e87bc71938605b98f7 (patch) | |
| tree | 435f17eccda20a1723f51330ee0403668c76afcd /modules/telegram.py | |
| parent | Add TimersContext, to be able to purge timers when modules are unloaded (diff) | |
| signature | ||
Pass context-wrapped timers to each module, add ModuleManager.BaseModule.on_load
Diffstat (limited to 'modules/telegram.py')
| -rw-r--r-- | modules/telegram.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/telegram.py b/modules/telegram.py index b836b2a8..0dd9bda7 100644 --- a/modules/telegram.py +++ b/modules/telegram.py @@ -9,13 +9,10 @@ from threading import Thread class Module(Thread): _name = "telegram" - def __init__(self, bot, events, exports): - key = bot.config.get("telegram-api-key") + def on_load(self): + key = self.bot.config.get("telegram-api-key") if not key: return - self.bot = bot - self.events = events - self.updater = telegram.ext.Updater(key) self.dispatcher = self.updater.dispatcher |
