Archived
1
0
Fork 0
This commit is contained in:
多羅狼 2023-04-19 13:03:08 +08:00 committed by GitHub
parent 40e167d4fe
commit 2653fb4b88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,14 +31,15 @@ async def _(msg: Bot.MessageSession):
# unsupported_currencies.append(target_currency)
# if unsupported_currencies:
# await msg.finish(f"{msg.locale.t('exchange_rate.message.error.invalid')}{' '.join(unsupported_currencies)}")
# exit()
# else:
# data = response.json()
# error_type = data['error-type']
# raise NoReportException(f"{error_type}")
amount = float(msg.parsed_msg['<amount>'])
amount = None
while amount is None:
try:
amount = float(msg.parsed_msg['<amount>'])
if amount <= 0:
await msg.finish(msg.locale.t('exchange_rate.message.error.non_positive'))
except ValueError: