A
A
andrew462020-07-22 16:00:23
Python
andrew46, 2020-07-22 16:00:23

Which library for creating a telegram bot in Python is better and more convenient?

You need to create a telegram bot, something like a freelance site. Which python library is better to choose?

In general, I found several different libraries:

  • AIOGram
  • python-telegram-bot
  • Telepot
  • Telegram Bot Service
  • telebot
  • twx.botapi
  • pyTelegramBotAPI

Perhaps someone already had experience in using different libraries?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Alexander, 2020-07-24
@andrew46

  • If a large project with high attendance and long support is expected, then aiogram has no alternative. They have trouble with the documentation, but there is a chat in TG where they will always prompt. There you can chat with the developer of this library.
  • If this is something simple for a dozen handlers and too lazy to figure it out for a long time, then python-telegram-bot has very detailed wikis, documentation, snippets. You can figure it out very quickly without experience ... you can also learn asynchrony with a simple @run_async decorator, you can even run serverless on which azure/google/aws/yandex functions thread with a free limit of 1000000 (azure) hits per month
  • If the bot api restrictions are too tight and you want to do what only the client can do (for example, upload files larger than 40Mb), then look towards telethon (also async) plus it communicates with the telegram servers not via request-respons, but via the MTProto protocol. In particular, you can look at Garnet - bot-friendly telethon

S
sijokun, 2020-07-22
@sijokun

AIgram

N
Nick, 2020-07-23
@c00re

Aiogram is currently the best, but it can be difficult for a beginner to use it. I advise you to start with pytelegrambotAPI

R
Ramis, 2020-08-28
@ramzis

Better, easier aiogram, but if you are harsh and don't like easy ways, then requests + Telegram Bot API . Article with Webhook Flask+requests , or c getUpdates requests .

G
Grigory Vdovenko, 2021-04-26
@Bwonsamdi

It depends on what the task is. If you've just started tinkering with this thing, the pyTelegramBotAPI library is a good idea. There are two ways to install:
1. With pip:
pip install pytelegrambotapi
2. From source (requires git):

$ git clone https://github.com/eternnoir/pyTelegramBotAPI.git
$ cd pyTelegramBotAPI
$ python setup.py install

More about telegram bot using pyTelegramBotAPI here: https://tproger.ru/translations/telegram-bot-creat...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question