From c2d675aa09a44a1c441059879f999cd9fd8454e2 Mon Sep 17 00:00:00 2001 From: Redume Date: Fri, 14 Jun 2024 14:35:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B2=D0=B5=D1=80=D0=BD=D1=83=D0=BB=20=D1=81?= =?UTF-8?q?=D1=82=D0=B0=D1=80=D1=82=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.py b/main.py index d9ecce0..9fd20b1 100644 --- a/main.py +++ b/main.py @@ -11,6 +11,7 @@ import logging import yaml from aiogram import Dispatcher, types, Bot +from aiogram.filters import CommandStart # Constants DDG_URL = 'https://duckduckgo.com/js/spice/currency' @@ -189,6 +190,15 @@ async def currency(inline_query: types.InlineQuery): await inline_reply(result_id, result, None, inline_query) +@dp.message(CommandStart()) +async def start(message: types.Message): + await message.answer("Привет! Бот может показывать курс обмена криптовалюты и фиатной валюты. " + "Бот используется с помощью инлайн-команд: " + "`@shirino_bot 12 usd rub` или `@shirino_bot usd rub`" + "\n\nИсходный код опубликован на [Github](https://github.com/redume/shirino)", + parse_mode="markdown") + + async def main() -> None: log.debug(config) bot = Bot(config['telegram_token'])