don't import python-telegram-bot at runtime if disabled in config
This commit is contained in:
@@ -5,7 +5,6 @@ import logging
|
||||
from typing import List
|
||||
|
||||
from freqtrade.rpc.rpc import RPC
|
||||
from freqtrade.rpc.telegram import Telegram
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -21,6 +20,7 @@ class RPCManager(object):
|
||||
# Enable telegram
|
||||
if freqtrade.config['telegram'].get('enabled', False):
|
||||
logger.info('Enabling rpc.telegram ...')
|
||||
from freqtrade.rpc.telegram import Telegram
|
||||
self.registered_modules.append(Telegram(freqtrade))
|
||||
|
||||
def cleanup(self) -> None:
|
||||
|
@@ -16,6 +16,8 @@ from freqtrade.rpc.rpc import RPC, RPCException
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
logger.debug('Included module rpc.telegram ...')
|
||||
|
||||
|
||||
def authorized_only(command_handler: Callable[[Any, Bot, Update], None]) -> Callable[..., Any]:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user