S
S
Semyon2021-12-26 16:05:32
Python
Semyon, 2021-12-26 16:05:32

How to run parallel process in Telegram bot in Python?

It is necessary to implement mailing to users of the Telegram bot (written on pyTelegramBotAPI). Since there can be many users, it is necessary to run the mailing process in a separate process, otherwise the bot will stop responding to other user commands. What tools can be used to achieve a given goal? I know that the pyTelegramBotAPI library provides for the asynchronous operation of the bot. But maybe it's better to use third-party libraries? Tell me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlmazKayum, 2021-12-26
@AlmazKayum

I use the Python threading module

I
InternetMaster, 2021-12-28
@InternetMaster

It is much better to run this process on a separate server altogether. For example, rent a server for 1 hour (with hourly payment) and go through the user base on it. In this case, the main script will work.
Well, or on the same server, but in a separate script, although this will take a resource from the server used.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question