Telegram-Bot in project with different threads #3878
Replies: 3 comments 6 replies
-
Hi. I guess a sane way to get this working is
|
Beta Was this translation helpful? Give feedback.
4 replies
-
Hi, I also have a similar program to yours (many classes to manage com ports and devices using threads) and I was trying to add a telegram bot to notify me of given events. However, I am finding some difficulties in implementing the bot in an elegant way; could you share the code? |
Beta Was this translation helpful? Give feedback.
0 replies
-
My program looks something like this:
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a relatively complex program which processes data from different interfaces. For this purpose, each interface runs in its own thread. The threads exchange data via queues. When certain events occur, I am notified via Telegram. I now need to update the Python version (v3.8 -> v3.11) and therefore also the Telegram library (v8 ->v20.5).
For example:
Thread1 is handling a COM port and puts a message to the queue. The telegram thread (and maybe other threads) is processing the message and sends a message to users.
Thread2 is handling a camera and saves photos. The telegram thread is getting the message with the location of the photo and sends this photo to users.
etc.
I am now having problems with the new implementation with async functions. I have already read that you should not use async functions and threading in parallel. I don't want to rewrite all my code now. Therefore I need an approach how to solve the problem.
Beta Was this translation helpful? Give feedback.
All reactions