diff --git a/docs/assets/telegram_forcebuy.png b/docs/assets/telegram_forcebuy.png new file mode 100644 index 000000000..b0592bff3 Binary files /dev/null and b/docs/assets/telegram_forcebuy.png differ diff --git a/docs/telegram-usage.md b/docs/telegram-usage.md index 377977892..340e67549 100644 --- a/docs/telegram-usage.md +++ b/docs/telegram-usage.md @@ -243,10 +243,14 @@ Return a summary of your profit/loss and performance. > **BITTREX:** Selling BTC/LTC with limit `0.01650000 (profit: ~-4.07%, -0.00008168)` -### /forcebuy +### /forcebuy [rate] > **BITTREX:** Buying ETH/BTC with limit `0.03400000` (`1.000000 ETH`, `225.290 USD`) +Omitting the pair will open a query asking for the pair to buy (based on the current whitelist). + +![Telegram force-buy screenshot](assets/telegram_forcebuy.png) + Note that for this to work, `forcebuy_enable` needs to be set to true. [More details](configuration.md#understand-forcebuy_enable) @@ -254,7 +258,8 @@ Note that for this to work, `forcebuy_enable` needs to be set to true. ### /performance Return the performance of each crypto-currency the bot has sold. -> Performance: + +> Performance: > 1. `RCN/BTC 57.77%` > 2. `PAY/BTC 56.91%` > 3. `VIB/BTC 47.07%` diff --git a/tests/rpc/test_rpc_telegram.py b/tests/rpc/test_rpc_telegram.py index a3147f956..6e818ff8d 100644 --- a/tests/rpc/test_rpc_telegram.py +++ b/tests/rpc/test_rpc_telegram.py @@ -930,6 +930,11 @@ def test_forcebuy_no_pair(default_conf, update, mocker) -> None: assert inline_msg_mock.call_args_list[0][1]['callback_query_handler'] == 'forcebuy' keyboard = inline_msg_mock.call_args_list[0][1]['keyboard'] assert reduce(lambda acc, x: acc + len(x), keyboard, 0) == 4 + update = MagicMock() + update.callback_query = MagicMock() + update.callback_query.data = 'XRP/USDT' + telegram._forcebuy_inline(update, None) + assert fbuy_mock.call_count == 1 def test_performance_handle(default_conf, update, ticker, fee,