2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Protect client by renaming the property to _client

This commit is contained in:
Dan 2018-06-03 17:54:57 +02:00
parent 7752aef338
commit 745049bda3
2 changed files with 6 additions and 6 deletions

View File

@ -583,10 +583,10 @@ def parse_messages(
)
if m.text:
m.text.init(m.client, m.entities or [])
m.text.init(m._client, m.entities or [])
if m.caption:
m.caption.init(m.client, m.caption_entities or [])
m.caption.init(m._client, m.caption_entities or [])
if message.reply_to_msg_id and replies:
while True:

View File

@ -260,7 +260,7 @@ class Message(Object):
reply_markup=None,
):
self.message_id = message_id # int
self.client = client
self._client = client
self.date = date # int
self.chat = chat # Chat
self.from_user = from_user # flags.0?User
@ -373,7 +373,7 @@ class Message(Object):
if reply_to_message_id is None and quote:
reply_to_message_id = self.message_id
return self.client.send_message(
return self._client.send_message(
chat_id=self.chat.id,
text=text,
parse_mode=parse_mode,
@ -418,7 +418,7 @@ class Message(Object):
Raises:
:class:`Error <pyrogram.Error>`
"""
return self.client.forward_messages(
return self._client.forward_messages(
chat_id=chat_id,
from_chat_id=self.chat.id,
message_ids=self.message_id,
@ -453,7 +453,7 @@ class Message(Object):
Raises:
:class:`Error <pyrogram.Error>`
"""
self.client.delete_messages(
self._client.delete_messages(
chat_id=self.chat.id,
message_ids=self.message_id,
revoke=revoke