From 5e9c1e34137502f7ded439abec6c04885007cfad Mon Sep 17 00:00:00 2001 From: Forevka <32968153+Forevka@users.noreply.github.com> Date: Sat, 3 Jul 2021 15:18:16 +0000 Subject: [PATCH] fixes based on review feedback --- aiogram/dispatcher/dispatcher.py | 1 + aiogram/utils/handlers_in_use.py | 4 ++-- examples/specify_updates.py | 11 +++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py index da68158d..109bb920 100644 --- a/aiogram/dispatcher/dispatcher.py +++ b/aiogram/dispatcher/dispatcher.py @@ -460,6 +460,7 @@ class Dispatcher(Router): :param polling_timeout: Poling timeout :param backoff_config: :param handle_as_tasks: Run task for each event and no wait result + :param allowed_updates: List of the update types you want your bot to receive :param kwargs: contextual data :return: """ diff --git a/aiogram/utils/handlers_in_use.py b/aiogram/utils/handlers_in_use.py index 866d3343..c1816476 100644 --- a/aiogram/utils/handlers_in_use.py +++ b/aiogram/utils/handlers_in_use.py @@ -4,14 +4,14 @@ from typing import List, cast from aiogram.dispatcher.dispatcher import Dispatcher from aiogram.dispatcher.router import Router -AIOGRAM_INTERNAL_HANDLERS = [ +INTERNAL_HANDLERS = [ "update", "error", ] def get_handlers_in_use( - dispatcher: Dispatcher, handlers_to_skip: List[str] = AIOGRAM_INTERNAL_HANDLERS + dispatcher: Dispatcher, handlers_to_skip: List[str] = INTERNAL_HANDLERS ) -> List[str]: handlers_in_use: List[str] = [] diff --git a/examples/specify_updates.py b/examples/specify_updates.py index f1368325..64b3c9fc 100644 --- a/examples/specify_updates.py +++ b/examples/specify_updates.py @@ -19,7 +19,15 @@ async def command_start_handler(message: Message) -> None: This handler receive messages with `/start` command """ - await message.answer(f"Hello, {message.from_user.full_name}!", reply_markup=InlineKeyboardMarkup(inline_keyboard=[[InlineKeyboardButton(text="Tap me, bro", callback_data="*")]])) + await message.answer(f"Hello, {message.from_user.full_name}!", + reply_markup=InlineKeyboardMarkup( + inline_keyboard=[ + [ + InlineKeyboardButton(text="Tap me, bro", callback_data="*") + ] + ] + ) + ) @dp.chat_member() @@ -33,7 +41,6 @@ sub_router = Router() async def callback_tap_me(callback_query: CallbackQuery) -> None: await callback_query.answer("Yeah good, now i'm fine") - # this router will use only edited_message updates sub_sub_router = Router()