Anonymous
Traceback (most recent call last):
File "main.py", line 1320, in <module>
bot.polling()
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 392, in polling
self.__threaded_polling(none_stop, interval, timeout)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 415, in __threaded_polling
polling_thread.raise_exceptions()
File "/usr/local/lib/python3.7/dist-packages/telebot/util.py", line 79, in raise_exceptions
six.reraise(self.exc_info[0], self.exc_info[1], self.exc_info[2])
File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise
raise value
File "/usr/local/lib/python3.7/dist-packages/telebot/util.py", line 60, in run
task(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 279, in __retrieve_updates
updates = self.get_updates(offset=(self.last_update_id + 1), timeout=timeout)
File "/usr/local/lib/python3.7/dist-packages/telebot/__init__.py", line 249, in get_updates
json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates)
File "/usr/local/lib/python3.7/dist-packages/telebot/apihelper.py", line 194, in get_updates
return _make_request(token, method_url, params=payload)
File "/usr/local/lib/python3.7/dist-packages/telebot/apihelper.py", line 58, in _make_request
timeout=(connect_timeout, read_timeout), proxies=proxy)
File "/home/dee/.local/lib/python3.7/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/dee/.local/lib/python3.7/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/dee/.local/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=30)
из-за чего появляется такая ошибка при работе бота?
Roman
Привет!
Мне надо запускать и держать в запущенном состоянии демон, причём не от рута, и не обязательно в системе с SystemD. Использую circus. Всё отлично, если бы не одно но: если запускать всё добро из shell, при выходе (Ctrl+D) оно намертво повисает, приходится жать Ctrl+C.
Вот минимальный пример:
from circus import get_arbiter
arbiter = get_arbiter([{"cmd": "sleep 100"}], background=True)
arbiter.start()
Эти строки надо запихнуть в shell (python/ipython — без разницы), потом нажать Ctrl+D, y.
Пробовал atexit и signal — не помогло.
Подскажите, пожалуйста, что можно ещё попробовать.
Witold
Hi guys.
I'm trying to create a bot that will automatically send messages to chat users of any app.
This bot should have the function to send a reply to incoming messages
(depending on how long it took the user to reply - for example, a user took 10 minutes to reply - so the bot will reply after 10 minutes +/- 2x/2).
I have an Android emulator and want to take over the navigation through an app and depending on that I want to write to each user, add them as a friend and reply to them.
Planned Apps are here:
Snapchat, Instagram, Telegram and Whatsapp.
Does anyone have an idea or questions about how to continue my project?