diff --git a/examples/text_filter_example.py b/examples/text_filter_example.py index a47a5c92..60d631e3 100644 --- a/examples/text_filter_example.py +++ b/examples/text_filter_example.py @@ -7,7 +7,8 @@ import logging from aiogram import Bot, Dispatcher, executor, types -API_TOKEN = 'API_TOKEN_HERE' + +API_TOKEN = 'BOT_TOKEN_HERE' # Configure logging logging.basicConfig(level=logging.INFO) @@ -16,10 +17,12 @@ logging.basicConfig(level=logging.INFO) bot = Bot(token=API_TOKEN) dp = Dispatcher(bot) + # if the text from user in the list @dp.message_handler(text=['text1', 'text2']) async def text_in_handler(message: types.Message): - await message.answer("The message text is in the list!") + await message.answer("The message text equals to one of in the list!") + # if the text contains any string @dp.message_handler(text_contains='example1') diff --git a/examples/throtling_example.py b/examples/throtling_example.py index 2641b44b..18563472 100644 --- a/examples/throtling_example.py +++ b/examples/throtling_example.py @@ -4,7 +4,6 @@ Example for throttling manager. You can use that for flood controlling. """ -import asyncio import logging from aiogram import Bot, types @@ -13,14 +12,15 @@ from aiogram.dispatcher import Dispatcher from aiogram.utils.exceptions import Throttled from aiogram.utils.executor import start_polling -API_TOKEN = 'BOT TOKEN HERE' + +API_TOKEN = 'BOT_TOKEN_HERE' logging.basicConfig(level=logging.INFO) bot = Bot(token=API_TOKEN) # Throttling manager does not work without Leaky Bucket. -# Then need to use storages. For example use simple in-memory storage. +# You need to use a storage. For example use simple in-memory storage. storage = MemoryStorage() dp = Dispatcher(bot, storage=storage)