Giter Site home page Giter Site logo

Comments (13)

Xh0st avatar Xh0st commented on June 16, 2024 1

Yes it's runing on a VPS. I will lett you know if this is working.

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

You have to either use systemd or PM2 to run it clienteles. For more take a look here.

from telegram-airdrop-bot.

Xh0st avatar Xh0st commented on June 16, 2024

Runing the script with pm2 and after some time still stop responding. This is the bot_log from pm2

Traceback (most recent call last):
File "/home/gargamel/airdrop/main.py", line 307, in
bot.polling()
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/init.py", line 514, in polling
self.__threaded_polling(none_stop, interval, timeout, long_polling_timeout)
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/init.py", line 573, in __threaded_polling
raise e
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/init.py", line 536, in __threaded_polling
self.worker_pool.raise_exceptions()
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/util.py", line 117, in raise_exceptions
raise self.exception_info
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/util.py", line 69, in run
task(*args, **kwargs)
File "/home/gargamel/airdrop/main.py", line 154, in handle_text
bot.send_message(message.chat.id,
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/init.py", line 768, in send_message
apihelper.send_message(self.token, chat_id, text, disable_web_page_preview, reply_to_message_id,
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/apihelper.py", line 225, in send_message
return _make_request(token, method_url, params=payload, method='post')
File "/home/gargamel/.local/lib/python3.8/site-packages/telebot/apihelper.py", line 126, in _make_request
result = _get_req_session().request(
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', OSError("(110, 'ETIMEDOUT')"))

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

Do you run the bot on a VPS? Because it looks like a network problem.

You can try the following. Replace bot.polling() in main.py with:

  try:
    bot.polling()
  except OSError:
    print("Connection Error. Reconnecting...")
    time.sleep(1)
    bot.polling()

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

I just edited the message. You might want to include the print statement.

from telegram-airdrop-bot.

Xh0st avatar Xh0st commented on June 16, 2024

still same issue. I have two bots running on azure and only this one it's sleeping after a period of time.

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

Odd, never happened to me and I am also not able to reproduce it.

from telegram-airdrop-bot.

Xh0st avatar Xh0st commented on June 16, 2024

I have setup an script and sending /start command to the bot every 5 minutes and it's working now, not going to sleep anymore.

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

What a pita. But if it works.

from telegram-airdrop-bot.

Xh0st avatar Xh0st commented on June 16, 2024

What a pita. But if it works.

on my raspberry pi it's working perfectly but on azure it's going to sleep. Solved this issue for myself by disabling threading
bot = telebot.TeleBot(config.token, threaded=False)

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

Interesting. Are you using the bot behind a Webhook now and it still goes into sleep?

from telegram-airdrop-bot.

Xh0st avatar Xh0st commented on June 16, 2024

Interesting. Are you using the bot behind a Webhook now and it still goes into sleep?

I'm not using it behind a Webhook I have an other bot running behind a webhook.

from telegram-airdrop-bot.

fabston avatar fabston commented on June 16, 2024

Yea that's the issue with the Webhook setup. Well if threaded=False did the trick I guess you don't need the Webhook solution.

from telegram-airdrop-bot.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.