Skip to content

TG bot in a separate thread... again. #4167

Closed Answered by Bibo-Joshi
b-ferd asked this question in Q&A
Discussion options

You must be logged in to vote

since it's often unclear to me which examples still apply and which are outdated

The content of

is always the latest stable status.

Regarding running PTB in a separate thread:
There is nothing inheritedly stopping you from doing that. you might need to create an event loop in the non-main-thread, but otherwise it should be possible to e.g. simply run echobot in that non-main-thread. This is in fact rather a general Python question and not specific to PTB.

I realized that I had read here that PTB is not thread safe.
This probably means that I can't use one thread for receivi…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by b-ferd
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants