mirror of
https://github.com/Redume/Shirino.git
synced 2024-11-23 16:56:23 +03:00
Compare commits
No commits in common. "c07fba01ad69a77ce0411973e0a2fd2b5f2d7102" and "e3f5396d1a2e8d4885a7165662b312aad167c938" have entirely different histories.
c07fba01ad
...
e3f5396d1a
2 changed files with 9 additions and 15 deletions
|
@ -1,8 +1,4 @@
|
||||||
{
|
{
|
||||||
"RUB": ["руб", "рубли", "рубля", "рублей", "рубль", "российский рубль", "rub", "rouble", "roubles", "russian rouble"],
|
"RUB": ["руб", "рубли", "рубля", "рублей", "рубль", "rub", "rouble", "roubles"],
|
||||||
"USD": ["доллары", "доллар", "доллара", "долларах", "долларов", "зеленых", "бакса", "баксов", "usd", "dollar", "dollars"],
|
"USD": ["доллары", "доллар", "доллара", "зеленых", "usd", "dollar", "dollars"]
|
||||||
"UAH": ["гривны", "гривен", "гривен", "hryvnia"],
|
|
||||||
"EUR": ["евро", "eur", "euro", "euros"],
|
|
||||||
"KZT": ["тенге", "казахстанский тенге", "kazakhstani tenge", "tenge"],
|
|
||||||
"TRY": ["турецкая лира", "турецких лир", "try", "tl", "Turkish lira", "lira"]
|
|
||||||
}
|
}
|
4
main.py
4
main.py
|
@ -16,7 +16,7 @@ dp = Dispatcher()
|
||||||
@dp.message()
|
@dp.message()
|
||||||
@dp.inline_query()
|
@dp.inline_query()
|
||||||
async def currency(query: types.Message | types.InlineQuery) -> None:
|
async def currency(query: types.Message | types.InlineQuery) -> None:
|
||||||
global result, from_currency_alias, conv_currency_alias
|
global result
|
||||||
|
|
||||||
try:
|
try:
|
||||||
currency_json = json.load(open('currency.json', 'r', encoding='utf-8'))
|
currency_json = json.load(open('currency.json', 'r', encoding='utf-8'))
|
||||||
|
@ -26,7 +26,6 @@ async def currency(query: types.Message | types.InlineQuery) -> None:
|
||||||
conv = Converter()
|
conv = Converter()
|
||||||
|
|
||||||
if len(args) <= 1:
|
if len(args) <= 1:
|
||||||
if query.chat.type not in ['supergroup', 'group']:
|
|
||||||
return await reply(result_id,
|
return await reply(result_id,
|
||||||
"2 or 3 arguments are required.",
|
"2 or 3 arguments are required.",
|
||||||
"@shirino_bot USD RUB "
|
"@shirino_bot USD RUB "
|
||||||
|
@ -44,7 +43,6 @@ async def currency(query: types.Message | types.InlineQuery) -> None:
|
||||||
from_currency_alias = args[0].lower()
|
from_currency_alias = args[0].lower()
|
||||||
conv_currency_alias = args[1].lower()
|
conv_currency_alias = args[1].lower()
|
||||||
else:
|
else:
|
||||||
if query.chat.type not in ['supergroup', 'group']:
|
|
||||||
return await reply(result_id, 'The source and target currency could not be determined.', None, query)
|
return await reply(result_id, 'The source and target currency could not be determined.', None, query)
|
||||||
|
|
||||||
from_currency, conv_currency = None, None
|
from_currency, conv_currency = None, None
|
||||||
|
|
Loading…
Add table
Reference in a new issue