@@ -48,8 +48,10 @@ def get_input_media_from_file_id(
4848 try :
4949 decoded = FileId .decode (file_id )
5050 except Exception :
51- raise ValueError (f'Failed to decode "{ file_id } ". The value does not represent an existing local file, '
52- f'HTTP URL, or valid file id.' )
51+ raise ValueError (
52+ f'Failed to decode "{ file_id } ". The value does not represent an existing local file, '
53+ f"HTTP URL, or valid file id."
54+ )
5355
5456 file_type = decoded .file_type
5557
@@ -82,7 +84,9 @@ def get_input_media_from_file_id(
8284 raise ValueError (f"Unknown file id: { file_id } " )
8385
8486
85- async def parse_messages (client , messages : "raw.types.messages.Messages" , replies : int = 1 ) -> List ["types.Message" ]:
87+ async def parse_messages (
88+ client , messages : "raw.types.messages.Messages" , replies : int = 1
89+ ) -> List ["types.Message" ]:
8690 users = {i .id : i for i in messages .users }
8791 chats = {i .id : i for i in messages .chats }
8892
@@ -138,10 +142,10 @@ def parse_deleted_messages(client, update) -> List["types.Message"]:
138142 types .Message (
139143 id = message ,
140144 chat = types .Chat (
141- id = get_channel_id (channel_id ),
142- type = enums . ChatType . CHANNEL ,
143- client = client
144- ) if channel_id is not None else None ,
145+ id = get_channel_id (channel_id ), type = enums . ChatType . CHANNEL , client = client
146+ )
147+ if channel_id is not None
148+ else None ,
145149 client = client
146150 )
147151 )
@@ -260,8 +264,9 @@ def xor(a: bytes, b: bytes) -> bytes:
260264 return bytes (i ^ j for i , j in zip (a , b ))
261265
262266
263- def compute_password_hash (algo : raw .types .PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow ,
264- password : str ) -> bytes :
267+ def compute_password_hash (
268+ algo : raw .types .PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow , password : str
269+ ) -> bytes :
265270 hash1 = sha256 (algo .salt1 + password .encode () + algo .salt1 )
266271 hash2 = sha256 (algo .salt2 + hash1 + algo .salt2 )
267272 hash3 = hashlib .pbkdf2_hmac ("sha512" , hash2 , algo .salt1 , 100000 )
0 commit comments