|
1 | 1 | # 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> |
3 | 3 | # |
4 | 4 | # This file is part of Pyrogram. |
5 | 5 | # |
|
32 | 32 | from typing import Union, List, Optional |
33 | 33 |
|
34 | 34 | import pyrogram |
| 35 | +from pyrogram import __version__, __license__ |
35 | 36 | from pyrogram import raw |
36 | 37 | from pyrogram import utils |
37 | 38 | from pyrogram.crypto import aes |
@@ -281,6 +282,10 @@ async def authorize(self) -> User: |
281 | 282 | if self.bot_token: |
282 | 283 | return await self.sign_in_bot(self.bot_token) |
283 | 284 |
|
| 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 | + |
284 | 289 | while True: |
285 | 290 | try: |
286 | 291 | if not self.phone_number: |
@@ -428,31 +433,30 @@ def set_parse_mode(self, parse_mode: Optional[str] = "combined"): |
428 | 433 |
|
429 | 434 | Example: |
430 | 435 | .. code-block:: python |
431 | | - :emphasize-lines: 10,14,18,22 |
432 | 436 |
|
433 | 437 | from pyrogram import Client |
434 | 438 |
|
435 | 439 | app = Client("my_account") |
436 | 440 |
|
437 | 441 | with app: |
438 | 442 | # 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>") |
440 | 444 |
|
441 | 445 | # Force Markdown-only, HTML is disabled |
442 | 446 | 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>") |
444 | 448 |
|
445 | 449 | # Force HTML-only, Markdown is disabled |
446 | 450 | 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>") |
448 | 452 |
|
449 | 453 | # Disable the parser completely |
450 | 454 | 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>") |
452 | 456 |
|
453 | 457 | # Bring back the default combined mode |
454 | 458 | 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>") |
456 | 460 | """ |
457 | 461 |
|
458 | 462 | self.parse_mode = parse_mode |
@@ -937,8 +941,8 @@ async def get_file( |
937 | 941 | await self.loop.run_in_executor(self.executor, func) |
938 | 942 |
|
939 | 943 | if len(chunk) < limit: |
940 | | - break |
941 | | - |
| 944 | + break |
| 945 | + |
942 | 946 | r = await session.send( |
943 | 947 | raw.functions.upload.GetFile( |
944 | 948 | location=location, |
|
0 commit comments