Skip to content

Errors while sending #2456

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

Open
dwpoint opened this issue Mar 9, 2025 · 2 comments
Open

Errors while sending #2456

dwpoint opened this issue Mar 9, 2025 · 2 comments

Comments

@dwpoint
Copy link

dwpoint commented Mar 9, 2025

For some reason there were errors when sending. It does not send right away. But then the messages still arrive. I just can't process their ID.

bot = telebot.TeleBot(token_tg, threaded=False)
def send_tg(photo, text):
    for i in range(5):
        try:
            msg = bot.send_photo(chat_id, open(photo, 'rb'), caption=text, parse_mode="HTML")
            return msg.message_id
        except Exception as e:
            log_with_time(f"Error: {e}")
            time.sleep(10)

09.03.2025 09:49:29: Error: ('Connection aborted.', TimeoutError('The write operation timed out'))
09.03.2025 09:50:09: Error: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=30)
09.03.2025 09:50:49: Error: HTTPSConnectionPool(host='api.telegram.org', port=443): Read timed out. (read timeout=30)

A little later these messages finally arrived. What could be the problem? The Internet is stable.

@Badiboy
Copy link
Collaborator

Badiboy commented Mar 9, 2025

It says it cannot read answer in given time. 🤷‍♂️

@dwpoint
Copy link
Author

dwpoint commented Mar 10, 2025

It says it cannot read answer in given time. 🤷‍♂️
@Badiboy

Yes, I understand that. Please guide me, what could be the cause of this error? And what can I try to do to fix it?

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