Skip to content

Commit 1c64795

Browse files
committed
Update to Pyrogram 1.3.5
1 parent 9ded11e commit 1c64795

337 files changed

Lines changed: 787 additions & 686 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

pyrogram/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#
@@ -16,9 +16,9 @@
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

19-
__version__ = "1.2.20"
19+
__version__ = "1.3.5"
2020
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
21-
__copyright__ = "Copyright (C) 2017-2022 Dan <https://github.com/delivrance>"
21+
__copyright__ = "Copyright (C) 2017-present Dan <https://github.com/delivrance>"
2222

2323
from concurrent.futures.thread import ThreadPoolExecutor
2424

pyrogram/client.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#
@@ -32,6 +32,7 @@
3232
from typing import Union, List, Optional
3333

3434
import pyrogram
35+
from pyrogram import __version__, __license__
3536
from pyrogram import raw
3637
from pyrogram import utils
3738
from pyrogram.crypto import aes
@@ -281,6 +282,10 @@ async def authorize(self) -> User:
281282
if self.bot_token:
282283
return await self.sign_in_bot(self.bot_token)
283284

285+
print(f"Welcome to Pyrogram (version {__version__})")
286+
print(f"Pyrogram is free software and comes with ABSOLUTELY NO WARRANTY. Licensed\n"
287+
f"under the terms of the {__license__}.\n")
288+
284289
while True:
285290
try:
286291
if not self.phone_number:
@@ -428,31 +433,30 @@ def set_parse_mode(self, parse_mode: Optional[str] = "combined"):
428433
429434
Example:
430435
.. code-block:: python
431-
:emphasize-lines: 10,14,18,22
432436
433437
from pyrogram import Client
434438
435439
app = Client("my_account")
436440
437441
with app:
438442
# Default combined mode: Markdown + HTML
439-
app.send_message("haskell", "1. **markdown** and <i>html</i>")
443+
app.send_message("me", "1. **markdown** and <i>html</i>")
440444
441445
# Force Markdown-only, HTML is disabled
442446
app.set_parse_mode("markdown")
443-
app.send_message("haskell", "2. **markdown** and <i>html</i>")
447+
app.send_message("me", "2. **markdown** and <i>html</i>")
444448
445449
# Force HTML-only, Markdown is disabled
446450
app.set_parse_mode("html")
447-
app.send_message("haskell", "3. **markdown** and <i>html</i>")
451+
app.send_message("me", "3. **markdown** and <i>html</i>")
448452
449453
# Disable the parser completely
450454
app.set_parse_mode(None)
451-
app.send_message("haskell", "4. **markdown** and <i>html</i>")
455+
app.send_message("me", "4. **markdown** and <i>html</i>")
452456
453457
# Bring back the default combined mode
454458
app.set_parse_mode()
455-
app.send_message("haskell", "5. **markdown** and <i>html</i>")
459+
app.send_message("me", "5. **markdown** and <i>html</i>")
456460
"""
457461

458462
self.parse_mode = parse_mode
@@ -937,8 +941,8 @@ async def get_file(
937941
await self.loop.run_in_executor(self.executor, func)
938942

939943
if len(chunk) < limit:
940-
break
941-
944+
break
945+
942946
r = await session.send(
943947
raw.functions.upload.GetFile(
944948
location=location,

pyrogram/connection/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#

pyrogram/connection/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#

pyrogram/connection/transport/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#

pyrogram/connection/transport/tcp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#

pyrogram/connection/transport/tcp/tcp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#

pyrogram/connection/transport/tcp/tcp_abridged.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#
@@ -17,7 +17,6 @@
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

1919
import logging
20-
2120
from typing import Optional
2221

2322
from .tcp import TCP

pyrogram/connection/transport/tcp/tcp_abridged_o.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#

pyrogram/connection/transport/tcp/tcp_full.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Pyrogram - Telegram MTProto API Client Library for Python
2-
# Copyright (C) 2017-2022 Dan <https://github.com/delivrance>
2+
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
33
#
44
# This file is part of Pyrogram.
55
#
@@ -17,9 +17,9 @@
1717
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818

1919
import logging
20-
from typing import Optional
2120
from binascii import crc32
2221
from struct import pack, unpack
22+
from typing import Optional
2323

2424
from .tcp import TCP
2525

0 commit comments

Comments
 (0)