From 95fcaaeed798e34b974245667cf5fc14ef05efbe Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 10 Aug 2019 22:09:29 +0300 Subject: [PATCH] Micro refactor --- aiogram/dispatcher/filters/builtin.py | 10 +++++----- examples/media_group.py | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/aiogram/dispatcher/filters/builtin.py b/aiogram/dispatcher/filters/builtin.py index b0324290..2e561bcd 100644 --- a/aiogram/dispatcher/filters/builtin.py +++ b/aiogram/dispatcher/filters/builtin.py @@ -149,7 +149,7 @@ class CommandStart(Command): :param deep_link: string or compiled regular expression (by ``re.compile(...)``). """ - super(CommandStart, self).__init__(['start']) + super().__init__(['start']) self.deep_link = deep_link async def check(self, message: types.Message): @@ -159,7 +159,7 @@ class CommandStart(Command): :param message: :return: """ - check = await super(CommandStart, self).check(message) + check = await super().check(message) if check and self.deep_link is not None: if not isinstance(self.deep_link, re.Pattern): @@ -179,7 +179,7 @@ class CommandHelp(Command): """ def __init__(self): - super(CommandHelp, self).__init__(['help']) + super().__init__(['help']) class CommandSettings(Command): @@ -188,7 +188,7 @@ class CommandSettings(Command): """ def __init__(self): - super(CommandSettings, self).__init__(['settings']) + super().__init__(['settings']) class CommandPrivacy(Command): @@ -197,7 +197,7 @@ class CommandPrivacy(Command): """ def __init__(self): - super(CommandPrivacy, self).__init__(['privacy']) + super().__init__(['privacy']) class Text(Filter): diff --git a/examples/media_group.py b/examples/media_group.py index eafbac6a..3d488364 100644 --- a/examples/media_group.py +++ b/examples/media_group.py @@ -2,7 +2,8 @@ import asyncio from aiogram import Bot, Dispatcher, executor, filters, types -API_TOKEN = 'BOT TOKEN HERE' + +API_TOKEN = 'BOT_TOKEN_HERE' bot = Bot(token=API_TOKEN) dp = Dispatcher(bot) @@ -13,10 +14,10 @@ async def send_welcome(message: types.Message): # So... At first I want to send something like this: await message.reply("Do you want to see many pussies? Are you ready?") - # And wait few seconds... + # Wait a little... await asyncio.sleep(1) - # Good bots should send chat actions. Or not. + # Good bots should send chat actions... await types.ChatActions.upload_photo() # Create media group