-3

I already have a script which checks my gmail inbox and twits the certain mails at certain intervals, for this i use a while True loop to have it run infinitely.

When i want to apply the same thing into a Telegram bot:

bot.polling() takes precedence over while True loop, or the the other way around. How to keep my while True loop running in a Telegram bot while the other functions of the bot without being interrupted?

angebot
  • 11
  • 1
  • 4
  • Hey. I have a *vague* idea, where this is going, but I'll need more details about how your bot is set up and which packages you are using. E.g., I have the strong impression that you're not using the `python-telegram-library` that you tagged. Please have a look at the [SO guide](https://stackoverflow.com/help/how-to-ask) on asking good questions. :) – CallMeStag Jul 06 '21 at 06:32

1 Answers1

0

No answer came in as yet, however i found a transient solution. I've made use of threading library and put the '''bot.polling()''' into o function and called this function in a thread. Basically, multithreading has resolved my issue.

angebot
  • 11
  • 1
  • 4