Make creating a new sender cleaner

This commit is contained in:
Lonami Exo
2017-09-30 12:08:06 +02:00
parent 5da300ca84
commit 0a567fcd7c
3 changed files with 12 additions and 8 deletions

View File

@@ -54,6 +54,10 @@ class MtProtoSender:
self._need_confirmation.clear()
self._clear_all_pending()
def clone(self):
"""Creates a copy of this MtProtoSender as a new connection"""
return MtProtoSender(self.session, self.connection.clone())
# region Send and receive
def send(self, *requests):