1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00
pyTelegramBotAPI/examples/webhook_examples
2018-08-17 12:47:44 +03:00
..
README.md Extend examples with aiohttp 2017-01-30 01:54:49 +06:00
webhook_aiohttp_echo_bot.py Extend examples with aiohttp 2017-01-30 01:54:49 +06:00
webhook_cherrypy_echo_bot.py Added option to disable CherryPy logging 2017-03-07 21:43:14 +03:00
webhook_cpython_echo_bot.py fix: python 2/3 compatibility in examples 2018-08-17 12:47:44 +03:00
webhook_flask_echo_bot.py Fix #253 #231 #485 2018-04-30 15:41:12 +03:00
webhook_flask_heroku_echo.py Make the Heroku example actual 2018-02-16 17:52:37 +02:00
webhook_tornado_echo_bot.py Added webhook example with Tornado 2017-03-23 15:34:33 +03:00

Webhook examples using pyTelegramBotAPI

There are 4 examples in this directory using different libraries:

  • Python (CPython): webhook_cpython_echo_bot.py

    • Pros:
      • Official python libraries, it works out of the box (doesn't require to install anything).
      • Works with Python 2 and Python 3 (need to be converted with 2to3).
    • Cons:
      • Ugly code.
      • Many things to handle yourself, this can lead to errors.
      • Not powerful, do the trick but the performance is low.
  • CherryPy (3.8.0): webhook_cherrypy_echo_bot.py

    • Pros:
      • It's a web application framework, cleaner code, uses objects for defining the web application.
      • Very good performance.
      • The project seems to be active, latest version is recent.
      • Works with Python 2 and Python 3.
    • Cons:
      • Some things are not very intuitive, reading the doc is a must.
  • Flask (0.10.1): webhook_flask_echo_bot.py

    • Pros:
      • It's a web application framework, cleaner code, uses decorator which can be nice.
      • Good performance.
      • It's intuitive if you know how web application works.
    • Cons:
      • The project seems not to be very active, latest version dates 2013.
      • They don't recommend to use it with Python 3, but may work.
      • May be a oversized for just handling webhook petitions.
  • aiohttp (1.2.0): webhook_aiohttp_echo_bot.py

    • Pros:
      • It's a web application framework
      • Python 3 compatible
      • Asynchronous, excellent perfomance
      • Utilizes new async/await syntax
    • Cons:
      • Requires Python 3.4.2+, don't work with Python 2

Latest update of this document: 2017-01-30