Merge pull request #9485 from stash86/bt-metrics

exposing bot_name to discord rpc field
This commit is contained in:
Matthias 2023-11-30 19:04:34 +01:00 committed by GitHub
commit 08db2f05aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@ class Discord(Webhook):
self.rpc = rpc
self.strategy = config.get('strategy', '')
self.timeframe = config.get('timeframe', '')
self.bot_name = config.get('bot_name', '')
self._url = config['discord']['webhook_url']
self._format = 'json'
@ -36,6 +37,7 @@ class Discord(Webhook):
msg['strategy'] = self.strategy
msg['timeframe'] = self.timeframe
msg['bot_name'] = self.bot_name
color = 0x0000FF
if msg['type'] in (RPCMessageType.EXIT, RPCMessageType.EXIT_FILL):
profit_ratio = msg.get('profit_ratio')