mirror of
https://github.com/Redume/Shirino.git
synced 2024-11-27 18:56:23 +03:00
Compare commits
2 commits
afb97be824
...
264fa1e98e
Author | SHA1 | Date | |
---|---|---|---|
|
264fa1e98e | ||
|
c9fd58d949 |
1 changed files with 14 additions and 5 deletions
15
main.py
15
main.py
|
@ -11,7 +11,7 @@ import requests
|
|||
|
||||
from pydantic import BaseSettings
|
||||
|
||||
from aiogram import Bot # type: ignore
|
||||
from aiogram import Bot, types # type: ignore
|
||||
from aiogram.dispatcher import Dispatcher # type: ignore
|
||||
from aiogram.utils import executor # type: ignore
|
||||
|
||||
|
@ -19,10 +19,11 @@ from aiogram.types import InlineQuery # type: ignore
|
|||
from aiogram.types import InlineQueryResultArticle
|
||||
from aiogram.types import InputTextMessageContent
|
||||
|
||||
|
||||
# Constants
|
||||
DDG_URL = 'https://duckduckgo.com/js/spice/currency'
|
||||
COINAPI_URL = 'https://rest.coinapi.io/v1/exchangerate'
|
||||
|
||||
|
||||
# ---
|
||||
|
||||
|
||||
|
@ -191,7 +192,6 @@ def rotate_token(lst: List[str], active: List[int]) -> None:
|
|||
|
||||
@dp.inline_handler()
|
||||
async def currency(inline_query: InlineQuery) -> None:
|
||||
|
||||
query = inline_query.query
|
||||
article: List[Optional[InlineQueryResultArticle]] = [None]
|
||||
|
||||
|
@ -237,4 +237,13 @@ async def currency(inline_query: InlineQuery) -> None:
|
|||
)
|
||||
|
||||
|
||||
@dp.message_handler(commands=['start'])
|
||||
async def start(message: types.Message):
|
||||
await message.answer("Hi! Bot can show the exchange rate of crypto and fiat currency. "
|
||||
"The bot is used through the inline commands "
|
||||
"`@shirino_bot 12 usd rub` or `@shirino_bot usd rub`"
|
||||
"\n\nThe bot is open source on [Github](https://github.com/redume/shirino)",
|
||||
parse_mode="markdown")
|
||||
|
||||
|
||||
executor.start_polling(dp, skip_updates=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue