diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 4c98f3fa3..546d00538 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -238,14 +238,14 @@ class Telegram(RPCHandler): msg_type = msg['type'] noti = '' if msg_type == RPCMessageType.SELL: - sell_noti = self._config['telegram'].get('notification_settings', {}).get(str(msg_type), {}) - # For backward compatibility sell still be string - if isinstance(noti, str): - noti = sell_noti - else: - noti = sell_noti.get(str(msg['sell_reason']), default_noti) + sell_noti = self._config['telegram'].get('notification_settings', {}).get(str(msg_type), {}) + # For backward compatibility sell still be string + if isinstance(noti, str): + noti = sell_noti + else: + noti = sell_noti.get(str(msg['sell_reason']), default_noti) else: - noti = self._config['telegram'].get('notification_settings', {}).get(str(msg_type), default_noti) + noti = self._config['telegram'].get('notification_settings', {}).get(str(msg_type), default_noti) if noti == 'off': logger.info(f"Notification '{msg_type}' not sent.")