diff --git a/modules/exchange_rate/__init__.py b/modules/exchange_rate/__init__.py index 98505bd9..6770c84d 100644 --- a/modules/exchange_rate/__init__.py +++ b/modules/exchange_rate/__init__.py @@ -37,10 +37,8 @@ async def _(msg: Bot.MessageSession): # error_type = data['error-type'] # raise NoReportException(f"{error_type}") - amount = None - while amount is None: + amount = float(msg.parsed_msg['']) try: - amount = float(msg.parsed_msg['']) if amount <= 0: await msg.finish(msg.locale.t('exchange_rate.message.error.non_positive')) except ValueError: