示例#1
0
 def command_risk(_, update):
     try:
         risk = float(TelegramApp.get_command_param("/set_risk", update))
         set_risk(risk)
         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.")
示例#2
0
文件: bot.py 项目: lipq525/OctoBot
 def command_risk(_, update):
     try:
         risk = float(TelegramApp.get_command_param("/set_risk", update))
         set_risk(risk)
         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."
         )
示例#3
0
 def set_command_risk(new_risk):
     return set_risk(new_risk)