Skip to content

Commit 6d7116d

Browse files
document SESSION_TIME_TO_LIVE
1 parent f939163 commit 6d7116d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* [F.A.Q.](#faq)
3535
* [Bot 2.0](#bot-20)
3636
* [How can I distinguish a User and a GroupChat in message.chat?](#how-can-i-distinguish-a-user-and-a-groupchat-in-messagechat)
37+
* [How can I handle reocurring ConnectionResetErrors?](#how-can-i-handle-reocurring-connectionreseterrors)
3738
* [The Telegram Chat Group](#the-telegram-chat-group)
3839
* [More examples](#more-examples)
3940
* [Bots using this API](#bots-using-this-api)
@@ -603,6 +604,10 @@ if message.chat.type == "channel":
603604

604605
```
605606

607+
### How can I handle reocurring ConnectionResetErrors?
608+
609+
Bot instances that were idle for a long time might be rejected by the server when sending a message due to a timeout of the last used session. Add `apihelper.SESSION_TIME_TO_LIVE = 5 * 60` to your initialisation to force recreation after 5 minutes without any activity.
610+
606611
## The Telegram Chat Group
607612

608613
Get help. Discuss. Chat.

0 commit comments

Comments
 (0)