Fix throttled docs

This commit is contained in:
birdi 2019-08-05 13:17:47 +03:00
parent 4d00b7c502
commit 4a52f97a68

View file

@ -1041,11 +1041,13 @@ class Dispatcher(DataMixin, ContextInstanceMixin):
Example: Example:
.. code-block:: python3 .. code-block:: python3
async def handler_throttled(message: types.Message, **kwargs): async def handler_throttled(message: types.Message, **kwargs):
message.answer("Throttled!") await message.answer("Throttled!")
@dp.throttled(handler_throttled) @dp.throttled(handler_throttled)
async def some_handler(message: types.Message ) async def some_handler(message: types.Message):
await message.answer("Didn't throttled!")
:param on_throttled: the callable object that should be either a function or return a coroutine :param on_throttled: the callable object that should be either a function or return a coroutine
:param key: key in storage :param key: key in storage