Make the telegram module vaguely optional

This commit is contained in:
Evelyn 2017-09-06 00:17:55 +01:00
parent 84bfe81182
commit 249a3b40b3

View file

@ -9,9 +9,12 @@ class Module(Thread):
_name = "telegram"
def __init__(self, dolphin):
key = dolphin.config.get("telegram-api-key")
if not key: return
self.dolphin = dolphin
self.updater = Updater(dolphin.config["telegram-api-key"])
self.updater = Updater(key)
self.dispatcher = self.updater.dispatcher
start_handler = CommandHandler("start", self.start)