Skip to content

Commit

Permalink
fix: 避免将 quote 概率设为 NaN (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mufanc authored Dec 13, 2023
1 parent 8a9f8b2 commit 3b405e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kmua/callbacks/quote.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ async def set_quote_probability(update: Update, context: ContextTypes.DEFAULT_TY
sent_message = await message.reply_text(except_text)
logger.info(f"Bot: {sent_message.text}")
return
if probability < 0 or probability > 1:
if not (probability >= 0 and probability <= 1):
sent_message = await message.reply_text(except_text)
logger.info(f"Bot: {sent_message.text}")
return
Expand Down

0 comments on commit 3b405e3

Please sign in to comment.