Webhook docs (#1248)

* Added documentation for polling/webhook modes

* Added changelog

* Added changelog
This commit is contained in:
Alex Root Junior 2023-08-06 16:59:29 +03:00 committed by GitHub
parent 62d4b9014c
commit b311d59fce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 2595 additions and 692 deletions

View file

@ -0,0 +1,32 @@
.. _long-polling:
############
Long-polling
############
Long-polling is a technology that allows a Telegram server to send updates in case
when you don't have dedicated IP address or port to receive webhooks for example
on a developer machine.
To use long-polling mode you should use :meth:`aiogram.dispatcher.dispatcher.Dispatcher.start_polling`
or :meth:`aiogram.dispatcher.dispatcher.Dispatcher.run_polling` methods.
.. note::
You can use polling from only one polling process per single Bot token,
in other case Telegram server will return an error.
.. note::
If you will need to scale your bot, you should use webhooks instead of long-polling.
.. note::
If you will use multibot mode, you should use webhook mode for all bots.
Example
=======
This example will show you how to create simple echo bot based on long-polling.
.. literalinclude:: ../../examples/echo_bot.py