mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-16 04:05:47 +00:00
misc: code consistency and bot instance creation (#1482)
* misc: code consistency and bot instance creation * Changelog for aiogram#1482 * misc: consistency of comments and dispatcher instance creation * misc: removed routers example * Update CHANGES/1482.misc.rst --------- Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
This commit is contained in:
parent
b08ba78898
commit
e3dc7d576b
13 changed files with 54 additions and 30 deletions
|
|
@ -5,6 +5,7 @@ from os import getenv
|
|||
from typing import Any, Dict
|
||||
|
||||
from aiogram import Bot, Dispatcher, F, Router, html
|
||||
from aiogram.client.default import DefaultBotProperties
|
||||
from aiogram.enums import ParseMode
|
||||
from aiogram.filters import Command, CommandStart
|
||||
from aiogram.fsm.context import FSMContext
|
||||
|
|
@ -124,10 +125,14 @@ async def show_summary(message: Message, data: Dict[str, Any], positive: bool =
|
|||
|
||||
|
||||
async def main():
|
||||
bot = Bot(token=TOKEN, parse_mode=ParseMode.HTML)
|
||||
# Initialize Bot instance with default bot properties which will be passed to all API calls
|
||||
bot = Bot(token=TOKEN, default=DefaultBotProperties(parse_mode=ParseMode.HTML))
|
||||
|
||||
dp = Dispatcher()
|
||||
|
||||
dp.include_router(form_router)
|
||||
|
||||
# Start event dispatching
|
||||
await dp.start_polling(bot)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue