mirror of
https://github.com/Redume/Shirino.git
synced 2025-02-04 09:58:57 +03:00
feat: Made a command to start
This commit is contained in:
parent
ad8dc2da35
commit
caac4f9a1f
1 changed files with 22 additions and 8 deletions
16
main.py
16
main.py
|
@ -11,6 +11,7 @@ from aiogram import Bot, Dispatcher, Router, types
|
|||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.webhook.aiohttp_server import SimpleRequestHandler, setup_application
|
||||
from aiogram.filters import CommandStart
|
||||
|
||||
import hashlib
|
||||
|
||||
|
@ -19,6 +20,19 @@ bot = Bot(token=config['telegram_token'], default=DefaultBotProperties(parse_mod
|
|||
|
||||
router = Router()
|
||||
|
||||
@router.message(CommandStart())
|
||||
async def start(message: types.Message):
|
||||
get_bot = await bot.get_me()
|
||||
await message.reply(
|
||||
'Shirino is a telegram bot for converting fiat or cryptocurrency. '
|
||||
'The example of use occurs via inline query:\n'
|
||||
f'@{get_bot.username} USD RUB \n'
|
||||
f'@{get_bot.username} 12 USD RUB \n\n'
|
||||
'[Source Code](https://github.com/Redume/Shirino)',
|
||||
parse_mode='markdown'
|
||||
)
|
||||
|
||||
|
||||
@router.inline_query()
|
||||
async def currency(query: types.InlineQuery) -> None:
|
||||
text = query.query.lower()
|
||||
|
@ -87,7 +101,7 @@ async def on_startup(bot: Bot) -> None:
|
|||
await bot.set_webhook(
|
||||
f"{config['webhook']['base_url']}{config['webhook']['path']}",
|
||||
secret_token=config['webhook']['secret_token'],
|
||||
allowed_updates=['inline_query']
|
||||
allowed_updates=['inline_query', 'message']
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue