def command_risk(_, update): if TelegramApp._is_valid_user(update): try: InterfaceBot.set_command_risk( float(TelegramApp.get_command_param("/set_risk", update))) update.message.reply_text("New risk set successfully.") except Exception: update.message.reply_text( "Failed to set new risk, please provide a number between 0 and 1." )
def command_risk(_, update): if TelegramApp._is_valid_user(update): try: result_risk = InterfaceBot.set_command_risk(float(TelegramApp.get_command_param("/set_risk", update))) TelegramApp._send_message(update, f"`Risk successfully set to {result_risk}.`") except Exception: TelegramApp._send_message(update, "`Failed to set new risk, please provide a number between 0 and 1.`")