Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bot.infinity_polling() is not working, without errors #2439

Open
webcartel-https opened this issue Dec 22, 2024 · 1 comment
Open

bot.infinity_polling() is not working, without errors #2439

webcartel-https opened this issue Dec 22, 2024 · 1 comment

Comments

@webcartel-https
Copy link

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? - 4.24.0

  2. What OS are you using? - Win

  3. What version of python are you using? - 3.12.4

I wrote a simple telegram bot that will give information when entering a certain command. In my script I used bot.infinity_polling(), but at some point it just stopped working.
The script starts,
All code work fine
and ... script closes, on bot.infinity_poling() line

Initially the script looked like this

# .... some shit code
try:
 bot.infinity_polling()
finally:
# ... more shit code

Then:
I tried this:

bot.infinity_polling()

Then i tried this:

bot.polling(non_stop=True)

Also a tried this:

th = threading.Thread(target=bot.infinity_polling).start()

I use python debugger, script stop working on bot.infinity_polling() line. The code below is not executed, the program simply terminates

@Badiboy
Copy link
Collaborator

Badiboy commented Dec 22, 2024

If the program terminates in spte of "finally" - the problem is somewhere in your code. Nothing about infinity_polling here: it does not terminate program anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants