Skip to content

Commit 9f26ac9

Browse files
committed
Merge branch 'develop' into __slots__
2 parents 34b51b6 + def3bda commit 9f26ac9

File tree

11 files changed

+116
-127
lines changed

11 files changed

+116
-127
lines changed

compiler/api/compiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ def start():
171171
shutil.rmtree("{}/functions".format(DESTINATION), ignore_errors=True)
172172

173173
with open("{}/source/auth_key.tl".format(HOME), encoding="utf-8") as auth, \
174-
open("{}/source/sys_msgs.tl".format(HOME), encoding="utf-8") as system, \
175-
open("{}/source/main_api.tl".format(HOME), encoding="utf-8") as api:
174+
open("{}/source/sys_msgs.tl".format(HOME), encoding="utf-8") as system, \
175+
open("{}/source/main_api.tl".format(HOME), encoding="utf-8") as api:
176176
schema = (auth.read() + system.read() + api.read()).splitlines()
177177

178178
with open("{}/template/mtproto.txt".format(HOME), encoding="utf-8") as f:

compiler/error/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def start():
7373
f_init.write("from .{}_{} import *\n".format(name.lower(), code))
7474

7575
with open("{}/source/{}".format(HOME, i), encoding="utf-8") as f_csv, \
76-
open("{}/{}_{}.py".format(DEST, name.lower(), code), "w", encoding="utf-8") as f_class:
76+
open("{}/{}_{}.py".format(DEST, name.lower(), code), "w", encoding="utf-8") as f_class:
7777
reader = csv.reader(f_csv, delimiter="\t")
7878

7979
super_class = caml(name)

pyrogram/client/methods/chats/restrict_chat.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525

2626
class RestrictChat(BaseClient):
2727
def restrict_chat(
28-
self,
29-
chat_id: Union[int, str],
30-
can_send_messages: bool = False,
31-
can_send_media_messages: bool = False,
32-
can_send_other_messages: bool = False,
33-
can_add_web_page_previews: bool = False,
34-
can_send_polls: bool = False,
35-
can_change_info: bool = False,
36-
can_invite_users: bool = False,
37-
can_pin_messages: bool = False
28+
self,
29+
chat_id: Union[int, str],
30+
can_send_messages: bool = False,
31+
can_send_media_messages: bool = False,
32+
can_send_other_messages: bool = False,
33+
can_add_web_page_previews: bool = False,
34+
can_send_polls: bool = False,
35+
can_change_info: bool = False,
36+
can_invite_users: bool = False,
37+
can_pin_messages: bool = False
3838
) -> Chat:
3939
"""Use this method to restrict a chat.
4040
Pass True for all boolean parameters to lift restrictions from a chat.

pyrogram/client/methods/chats/restrict_chat_member.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525

2626
class RestrictChatMember(BaseClient):
2727
def restrict_chat_member(
28-
self,
29-
chat_id: Union[int, str],
30-
user_id: Union[int, str],
31-
until_date: int = 0,
32-
can_send_messages: bool = False,
33-
can_send_media_messages: bool = False,
34-
can_send_other_messages: bool = False,
35-
can_add_web_page_previews: bool = False,
36-
can_send_polls: bool = False,
37-
can_change_info: bool = False,
38-
can_invite_users: bool = False,
39-
can_pin_messages: bool = False
28+
self,
29+
chat_id: Union[int, str],
30+
user_id: Union[int, str],
31+
until_date: int = 0,
32+
can_send_messages: bool = False,
33+
can_send_media_messages: bool = False,
34+
can_send_other_messages: bool = False,
35+
can_add_web_page_previews: bool = False,
36+
can_send_polls: bool = False,
37+
can_change_info: bool = False,
38+
can_invite_users: bool = False,
39+
can_pin_messages: bool = False
4040
) -> Chat:
4141
"""Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for
4242
this to work and must have the appropriate admin rights. Pass True for all boolean parameters to lift

pyrogram/client/methods/chats/update_chat_username.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def update_chat_username(self,
4545
"""
4646

4747
peer = self.resolve_peer(chat_id)
48-
48+
4949
if isinstance(peer, types.InputPeerChannel):
5050
return bool(
5151
self.send(

pyrogram/client/methods/messages/download_media.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ def download_media(self,
106106
else:
107107
raise ValueError(error_message)
108108
elif isinstance(message, (
109-
pyrogram.Photo,
110-
pyrogram.PhotoSize,
111-
pyrogram.Audio,
112-
pyrogram.Document,
113-
pyrogram.Video,
114-
pyrogram.Voice,
115-
pyrogram.VideoNote,
116-
pyrogram.Sticker,
117-
pyrogram.Animation
109+
pyrogram.Photo,
110+
pyrogram.PhotoSize,
111+
pyrogram.Audio,
112+
pyrogram.Document,
113+
pyrogram.Video,
114+
pyrogram.Voice,
115+
pyrogram.VideoNote,
116+
pyrogram.Sticker,
117+
pyrogram.Animation
118118
)):
119119
if isinstance(message, pyrogram.Photo):
120120
media = pyrogram.Document(

pyrogram/client/methods/messages/send_cached_media.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828

2929
class SendCachedMedia(BaseClient):
3030
def send_cached_media(
31-
self,
32-
chat_id: Union[int, str],
33-
file_id: str,
34-
caption: str = "",
35-
parse_mode: str = "",
36-
disable_notification: bool = None,
37-
reply_to_message_id: int = None,
38-
reply_markup: Union[
39-
"pyrogram.InlineKeyboardMarkup",
40-
"pyrogram.ReplyKeyboardMarkup",
41-
"pyrogram.ReplyKeyboardRemove",
42-
"pyrogram.ForceReply"
43-
] = None
31+
self,
32+
chat_id: Union[int, str],
33+
file_id: str,
34+
caption: str = "",
35+
parse_mode: str = "",
36+
disable_notification: bool = None,
37+
reply_to_message_id: int = None,
38+
reply_markup: Union[
39+
"pyrogram.InlineKeyboardMarkup",
40+
"pyrogram.ReplyKeyboardMarkup",
41+
"pyrogram.ReplyKeyboardRemove",
42+
"pyrogram.ForceReply"
43+
] = None
4444
) -> Union["pyrogram.Message", None]:
4545
"""Use this method to send any media stored on the Telegram servers using a file_id.
4646

pyrogram/client/types/user_and_chats/chat_permissions.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -102,27 +102,27 @@ class ChatPermissions(PyrogramType):
102102
]
103103

104104
def __init__(
105-
self,
106-
*,
107-
until_date: int = None,
108-
109-
# Admin permissions
110-
can_be_edited: bool = None,
111-
can_change_info: bool = None,
112-
can_post_messages: bool = None, # Channels only
113-
can_edit_messages: bool = None, # Channels only
114-
can_delete_messages: bool = None,
115-
can_restrict_members: bool = None,
116-
can_invite_users: bool = None,
117-
can_pin_messages: bool = None, # Supergroups only
118-
can_promote_members: bool = None,
119-
120-
# Restricted user permissions
121-
can_send_messages: bool = None, # Text, contacts, locations and venues
122-
can_send_media_messages: bool = None, # Audios, documents, photos, videos, video notes and voice notes
123-
can_send_other_messages: bool = None, # Animations (GIFs), games, stickers, inline bot results
124-
can_add_web_page_previews: bool = None,
125-
can_send_polls: bool = None
105+
self,
106+
*,
107+
until_date: int = None,
108+
109+
# Admin permissions
110+
can_be_edited: bool = None,
111+
can_change_info: bool = None,
112+
can_post_messages: bool = None, # Channels only
113+
can_edit_messages: bool = None, # Channels only
114+
can_delete_messages: bool = None,
115+
can_restrict_members: bool = None,
116+
can_invite_users: bool = None,
117+
can_pin_messages: bool = None, # Supergroups only
118+
can_promote_members: bool = None,
119+
120+
# Restricted user permissions
121+
can_send_messages: bool = None, # Text, contacts, locations and venues
122+
can_send_media_messages: bool = None, # Audios, documents, photos, videos, video notes and voice notes
123+
can_send_other_messages: bool = None, # Animations (GIFs), games, stickers, inline bot results
124+
can_add_web_page_previews: bool = None,
125+
can_send_polls: bool = None
126126
):
127127
super().__init__(None)
128128

@@ -146,11 +146,11 @@ def __init__(
146146

147147
@staticmethod
148148
def _parse(
149-
entity: Union[
150-
types.ChannelParticipantAdmin,
151-
types.ChannelParticipantBanned,
152-
types.ChatBannedRights
153-
]
149+
entity: Union[
150+
types.ChannelParticipantAdmin,
151+
types.ChannelParticipantBanned,
152+
types.ChatBannedRights
153+
]
154154
) -> "ChatPermissions":
155155
if isinstance(entity, types.ChannelParticipantAdmin):
156156
permissions = entity.admin_rights
@@ -178,8 +178,8 @@ def _parse(
178178
can_send_messages=not denied_permissions.send_messages,
179179
can_send_media_messages=not denied_permissions.send_media,
180180
can_send_other_messages=(
181-
not denied_permissions.send_stickers or not denied_permissions.send_gifs or
182-
not denied_permissions.send_games or not denied_permissions.send_inline
181+
not denied_permissions.send_stickers or not denied_permissions.send_gifs or
182+
not denied_permissions.send_games or not denied_permissions.send_inline
183183
),
184184
can_add_web_page_previews=not denied_permissions.embed_links,
185185
can_send_polls=not denied_permissions.send_polls,

pyrogram/connection/transport/tcp/tcp_abridged_o.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ def connect(self, address: tuple):
4040
while True:
4141
nonce = bytearray(os.urandom(64))
4242

43-
if (nonce[0] != b"\xef"
44-
and nonce[:4] not in self.RESERVED
45-
and nonce[4:4] != b"\x00" * 4):
43+
if nonce[0] != b"\xef" and nonce[:4] not in self.RESERVED and nonce[4:4] != b"\x00" * 4:
4644
nonce[56] = nonce[57] = nonce[58] = nonce[59] = 0xef
4745
break
4846

pyrogram/connection/transport/tcp/tcp_intermediate_o.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ def connect(self, address: tuple):
4141
while True:
4242
nonce = bytearray(os.urandom(64))
4343

44-
if (nonce[0] != b"\xef"
45-
and nonce[:4] not in self.RESERVED
46-
and nonce[4:4] != b"\x00" * 4):
44+
if nonce[0] != b"\xef" and nonce[:4] not in self.RESERVED and nonce[4:4] != b"\x00" * 4:
4745
nonce[56] = nonce[57] = nonce[58] = nonce[59] = 0xee
4846
break
4947

0 commit comments

Comments
 (0)