diff --git a/configs/auth.json.example b/configs/auth.json.example index 04c8fa5e35..441a1c1f2d 100644 --- a/configs/auth.json.example +++ b/configs/auth.json.example @@ -7,5 +7,6 @@ {"name": "Milan", "coords": "45.472849,9.177567"} ], "gmapkey": "GOOGLE_MAPS_API_KEY", - "encrypt_location": "" + "encrypt_location": "", + "telegram_token": "" } diff --git a/configs/config.json.example b/configs/config.json.example index be57cb6c8f..320cadcf1f 100644 --- a/configs/config.json.example +++ b/configs/config.json.example @@ -10,8 +10,7 @@ { "type": "TelegramTask", "config": { - "enabled": false, - "api_key": "" + "enabled": false } }, { diff --git a/pokecli.py b/pokecli.py index f42feedbdc..d57aa76caa 100644 --- a/pokecli.py +++ b/pokecli.py @@ -628,6 +628,7 @@ def _json_loader(filename): config.favorite_locations = load.get('favorite_locations', []) config.encrypt_location = load.get('encrypt_location', '') + config.telegram_token = load.get('telegram_token', '') config.catch = load.get('catch', {}) config.release = load.get('release', {}) config.plugins = load.get('plugins', []) diff --git a/pokemongo_bot/cell_workers/telegram_task.py b/pokemongo_bot/cell_workers/telegram_task.py index 3ae5dcc1da..8dbd5a00ac 100644 --- a/pokemongo_bot/cell_workers/telegram_task.py +++ b/pokemongo_bot/cell_workers/telegram_task.py @@ -11,7 +11,7 @@ class TelegramTask(BaseTask): tbot = None def initialize(self): - api_key = self.config.get('api_key') + api_key = self.bot.config.telegram_token if api_key == None: self.emit_event( 'config_error',