Make certain methods and members private

This commit is contained in:
Lonami Exo
2017-05-29 17:06:48 +02:00
parent 63b1881c83
commit 452532cce7
3 changed files with 126 additions and 126 deletions

View File

@@ -23,7 +23,7 @@ class MtProtoPlainSender:
"""Sends a plain packet (auth_key_id = 0) containing the given message body (data)"""
with BinaryWriter() as writer:
writer.write_long(0)
writer.write_long(self.get_new_msg_id())
writer.write_long(self._get_new_msg_id())
writer.write_int(len(data))
writer.write(data)
@@ -41,7 +41,7 @@ class MtProtoPlainSender:
response = reader.read(message_length)
return response
def get_new_msg_id(self):
def _get_new_msg_id(self):
"""Generates a new message ID based on the current time (in ms) since epoch"""
# See https://core.telegram.org/mtproto/description#message-identifier-msg-id
ms_time = int(time.time() * 1000)