mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
misc: code consistency and bot instance creation
This commit is contained in:
parent
a7d3e9a720
commit
df1ab06762
11 changed files with 32 additions and 20 deletions
|
|
@ -8,7 +8,8 @@ from os import getenv
|
|||
|
||||
from aiohttp import web
|
||||
|
||||
from aiogram import Bot, Dispatcher, Router, types
|
||||
from aiogram import Bot, Dispatcher, Router
|
||||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.filters import CommandStart
|
||||
from aiogram.types import FSInputFile, Message
|
||||
|
|
@ -54,7 +55,7 @@ async def command_start_handler(message: Message) -> None:
|
|||
|
||||
|
||||
@router.message()
|
||||
async def echo_handler(message: types.Message) -> None:
|
||||
async def echo_handler(message: Message) -> None:
|
||||
"""
|
||||
Handler will forward receive a message back to the sender
|
||||
|
||||
|
|
@ -90,7 +91,7 @@ def main() -> None:
|
|||
dp.startup.register(on_startup)
|
||||
|
||||
# Initialize Bot instance with a default parse mode which will be passed to all API calls
|
||||
bot = Bot(TOKEN, parse_mode=ParseMode.HTML)
|
||||
bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML))
|
||||
|
||||
# Create aiohttp.web.Application instance
|
||||
app = web.Application()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue