From 3b15cce07a33d2bf2d27649a929e9f62ab310aec Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 2 Sep 2019 20:17:47 +0200 Subject: [PATCH] Handle arguments uniformly (by using context.args) --- freqtrade/rpc/telegram.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index 4b64ee31e..d11fc02ab 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -407,7 +407,7 @@ class Telegram(RPC): :return: None """ - trade_id = update.message.text.replace('/forcesell', '').strip() + trade_id = context.args[0] if len(context.args) > 0 else None try: msg = self._rpc_forcesell(trade_id) self._send_msg('Forcesell Result: `{result}`'.format(**msg)) @@ -425,9 +425,8 @@ class Telegram(RPC): :return: None """ - message = update.message.text.replace('/forcebuy', '').strip().split() - pair = message[0] - price = float(message[1]) if len(message) > 1 else None + pair = context.args[0] + price = float(context.args[1]) if len(context.args) > 1 else None try: self._rpc_forcebuy(pair, price) except RPCException as e: