Revert "Add telegram /delete command to delete tradeid"

This reverts commit 08fdd7d863.
This commit is contained in:
thopd88 2020-07-20 10:54:17 +07:00
parent 08fdd7d863
commit 28f4a1101e
2 changed files with 0 additions and 41 deletions

View File

@ -537,28 +537,6 @@ class RPC:
else:
return None
def _rpc_delete(self, trade_id: str) -> Dict[str, str]:
"""
Handler for delete <id>.
Delete the given trade
"""
def _exec_delete(trade: Trade) -> None:
Trade.session.delete(trade)
Trade.session.flush()
with self._freqtrade._sell_lock:
trade = Trade.get_trades(
trade_filter=[Trade.id == trade_id, ]
).first()
if not trade:
logger.warning('delete: Invalid argument received')
raise RPCException('invalid argument')
_exec_delete(trade)
Trade.session.flush()
self._freqtrade.wallets.update()
return {'result': f'Deleted trade {trade_id}.'}
def _rpc_performance(self) -> List[Dict[str, Any]]:
"""
Handler for performance.

View File

@ -93,7 +93,6 @@ class Telegram(RPC):
CommandHandler('forcesell', self._forcesell),
CommandHandler('forcebuy', self._forcebuy),
CommandHandler('trades', self._trades),
CommandHandler('delete', self._delete),
CommandHandler('performance', self._performance),
CommandHandler('daily', self._daily),
CommandHandler('count', self._count),
@ -498,24 +497,6 @@ class Telegram(RPC):
except RPCException as e:
self._send_msg(str(e))
@authorized_only
def _delete(self, update: Update, context: CallbackContext) -> None:
"""
Handler for /delete <id>.
Delete the given trade
:param bot: telegram bot
:param update: message update
:return: None
"""
trade_id = context.args[0] if len(context.args) > 0 else None
try:
msg = self._rpc_delete(trade_id)
self._send_msg('Delete Result: `{result}`'.format(**msg))
except RPCException as e:
self._send_msg(str(e))
@authorized_only
def _trades(self, update: Update, context: CallbackContext) -> None:
"""