Update telegram.py
This commit is contained in:
parent
e5c84b22bb
commit
4cca1cca85
@ -238,7 +238,12 @@ class Telegram(RPCHandler):
|
|||||||
msg_type = str(msg['type'])
|
msg_type = str(msg['type'])
|
||||||
noti = ''
|
noti = ''
|
||||||
if msg_type == RPCMessageType.SELL:
|
if msg_type == RPCMessageType.SELL:
|
||||||
noti = self._config['telegram'].get('notification_settings', {}).get(msg_type, {}).get(str(msg['sell_reason']), default_noti)
|
sell_noti = self._config['telegram'].get('notification_settings', {}).get(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:
|
else:
|
||||||
noti = self._config['telegram'].get('notification_settings', {}).get(msg_type, default_noti)
|
noti = self._config['telegram'].get('notification_settings', {}).get(msg_type, default_noti)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user