mirror of
https://github.com/Redume/Shirino.git
synced 2025-02-04 09:58:57 +03:00
chore: Made a check if the currency rate was not found
This commit is contained in:
parent
c9eb773f10
commit
db79e74268
1 changed files with 4 additions and 4 deletions
8
main.py
8
main.py
|
@ -78,12 +78,12 @@ async def currency(query: types.InlineQuery) -> None:
|
||||||
)],
|
)],
|
||||||
query)
|
query)
|
||||||
|
|
||||||
if not conv_currency or not from_currency:
|
|
||||||
return await reply(result_id, [('The currency exchange rate could not be found.', None, None)], query)
|
|
||||||
|
|
||||||
conv.from_currency = from_currency.upper()
|
conv.from_currency = from_currency.upper()
|
||||||
conv.conv_currency = conv_currency.upper()
|
conv.conv_currency = conv_currency.upper()
|
||||||
await conv.convert()
|
try:
|
||||||
|
await conv.convert()
|
||||||
|
except RuntimeError as e:
|
||||||
|
return await reply(result_id, [('The currency exchange rate could not be determined', None, None)], query)
|
||||||
|
|
||||||
chart = await create_chart(from_currency, conv_currency)
|
chart = await create_chart(from_currency, conv_currency)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue