Merge pull request #77 from gcarq/help-command
Help command to Telegram bot
This commit is contained in:
commit
96790d50e5
@ -45,6 +45,7 @@ def init(config: dict) -> None:
|
||||
CommandHandler('stop', _stop),
|
||||
CommandHandler('forcesell', _forcesell),
|
||||
CommandHandler('performance', _performance),
|
||||
CommandHandler('help', _help),
|
||||
]
|
||||
for handle in handles:
|
||||
_updater.dispatcher.add_handler(handle)
|
||||
@ -301,6 +302,27 @@ def _performance(bot: Bot, update: Update) -> None:
|
||||
send_msg(message, parse_mode=ParseMode.HTML)
|
||||
|
||||
|
||||
@authorized_only
|
||||
def _help(bot: Bot, update: Update) -> None:
|
||||
"""
|
||||
Handler for /help.
|
||||
Show commands of the bot
|
||||
:param bot: telegram bot
|
||||
:param update: message update
|
||||
:return: None
|
||||
"""
|
||||
message = """
|
||||
*/start:* `Starts the trader`
|
||||
*/stop:* `Stops the trader`
|
||||
*/status:* `Lists all open trades`
|
||||
*/profit:* `Lists cumulative profit from all finished trades`
|
||||
*/forcesell <trade_id>:* `Instantly sells the given trade, regardless of profit`
|
||||
*/performance:* `Show performance of each finished trade grouped by pair`
|
||||
*/help:* `This help message`
|
||||
"""
|
||||
send_msg(message, bot=bot)
|
||||
|
||||
|
||||
def send_msg(msg: str, bot: Bot = None, parse_mode: ParseMode = ParseMode.MARKDOWN) -> None:
|
||||
"""
|
||||
Send given markdown message
|
||||
|
@ -1,6 +1,6 @@
|
||||
-e git+https://github.com/ericsomdahl/python-bittrex.git@d7033d0#egg=python-bittrex
|
||||
SQLAlchemy==1.1.14
|
||||
python-telegram-bot==8.0
|
||||
python-telegram-bot==8.1.1
|
||||
arrow==0.10.0
|
||||
requests==2.18.4
|
||||
urllib3==1.22
|
||||
|
Loading…
Reference in New Issue
Block a user