mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-14 10:53:23 +00:00
Webhook docs (#1248)
* Added documentation for polling/webhook modes * Added changelog * Added changelog
This commit is contained in:
parent
62d4b9014c
commit
b311d59fce
37 changed files with 2595 additions and 692 deletions
32
docs/dispatcher/long_polling.rst
Normal file
32
docs/dispatcher/long_polling.rst
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue