Pytdbot 0.8.8.dev0__tar.gz → 0.9.0.dev2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/LICENSE +1 -1
  2. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/PKG-INFO +31 -29
  3. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/Pytdbot.egg-info/PKG-INFO +31 -29
  4. Pytdbot-0.9.0.dev2/Pytdbot.egg-info/SOURCES.txt +37 -0
  5. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/Pytdbot.egg-info/requires.txt +1 -0
  6. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/README.md +30 -28
  7. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/__init__.py +4 -2
  8. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/client.py +374 -411
  9. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/exception/__init__.py +2 -2
  10. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/filters.py +3 -2
  11. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/handlers/decorators.py +40 -3
  12. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/handlers/handler.py +4 -2
  13. Pytdbot-0.8.8.dev0/pytdbot/handlers/updates.py → Pytdbot-0.9.0.dev2/pytdbot/handlers/td_updates.py +1443 -405
  14. Pytdbot-0.9.0.dev2/pytdbot/methods/methods.py +1475 -0
  15. Pytdbot-0.9.0.dev2/pytdbot/methods/td_functions.py +18262 -0
  16. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/tdjson/tdjson.py +11 -25
  17. Pytdbot-0.9.0.dev2/pytdbot/types/__init__.py +3593 -0
  18. Pytdbot-0.9.0.dev2/pytdbot/types/td_types/__init__.py +1 -0
  19. Pytdbot-0.9.0.dev2/pytdbot/types/td_types/bound_methods/__init__.py +3 -0
  20. {Pytdbot-0.8.8.dev0/pytdbot/types/update → Pytdbot-0.9.0.dev2/pytdbot/types/td_types/bound_methods}/chatActions.py +50 -17
  21. Pytdbot-0.9.0.dev2/pytdbot/types/td_types/bound_methods/file.py +35 -0
  22. Pytdbot-0.9.0.dev2/pytdbot/types/td_types/bound_methods/message.py +818 -0
  23. Pytdbot-0.9.0.dev2/pytdbot/types/td_types/types.py +79145 -0
  24. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/utils/__init__.py +14 -0
  25. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/utils/escape.py +3 -2
  26. Pytdbot-0.9.0.dev2/pytdbot/utils/json_utils.py +23 -0
  27. Pytdbot-0.9.0.dev2/pytdbot/utils/obj_encoder.py +38 -0
  28. Pytdbot-0.9.0.dev2/pytdbot/utils/strings.py +33 -0
  29. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/utils/text_format.py +70 -44
  30. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/requirements.txt +1 -0
  31. Pytdbot-0.8.8.dev0/Pytdbot.egg-info/SOURCES.txt +0 -55
  32. Pytdbot-0.8.8.dev0/pytdbot/generate_files.py +0 -145
  33. Pytdbot-0.8.8.dev0/pytdbot/generate_json.py +0 -92
  34. Pytdbot-0.8.8.dev0/pytdbot/methods/methods.py +0 -1789
  35. Pytdbot-0.8.8.dev0/pytdbot/methods/tdlibfunctions.py +0 -15841
  36. Pytdbot-0.8.8.dev0/pytdbot/td_api.json +0 -32715
  37. Pytdbot-0.8.8.dev0/pytdbot/td_api.tl +0 -9655
  38. Pytdbot-0.8.8.dev0/pytdbot/types/__init__.py +0 -45
  39. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/__init__.py +0 -15
  40. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/base.py +0 -4
  41. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/force_reply.py +0 -33
  42. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/inline_keyboard.py +0 -228
  43. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/remove_keyboard.py +0 -25
  44. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/show_keyboard.py +0 -254
  45. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/__init__.py +0 -15
  46. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/base.py +0 -6
  47. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_generated.py +0 -39
  48. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_id.py +0 -14
  49. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_local.py +0 -21
  50. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_remote.py +0 -14
  51. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_thumbnail.py +0 -29
  52. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/__init__.py +0 -7
  53. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/base.py +0 -8
  54. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/log_stream_default.py +0 -8
  55. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/log_stream_empty.py +0 -8
  56. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/log_stream_file.py +0 -40
  57. Pytdbot-0.8.8.dev0/pytdbot/types/result/__init__.py +0 -3
  58. Pytdbot-0.8.8.dev0/pytdbot/types/result/result.py +0 -100
  59. Pytdbot-0.8.8.dev0/pytdbot/types/update/__init__.py +0 -4
  60. Pytdbot-0.8.8.dev0/pytdbot/types/update/update.py +0 -1736
  61. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/MANIFEST.in +0 -0
  62. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/Pytdbot.egg-info/dependency_links.txt +0 -0
  63. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/Pytdbot.egg-info/top_level.txt +0 -0
  64. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/handlers/__init__.py +0 -0
  65. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/methods/__init__.py +0 -0
  66. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/tdjson/__init__.py +0 -0
  67. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/pytdbot/types/plugins/__init__.py +0 -0
  68. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/setup.cfg +0 -0
  69. {Pytdbot-0.8.8.dev0 → Pytdbot-0.9.0.dev2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022-2023 Python TDLib
3
+ Copyright (c) 2022-2024 Python TDLib
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Pytdbot
3
- Version: 0.8.8.dev0
3
+ Version: 0.9.0.dev2
4
4
  Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
5
  Home-page: https://github.com/pytdbot/client
6
6
  Author: AYMEN Mohammed
@@ -14,16 +14,23 @@ Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
 
17
- # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.22-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot)
17
+ # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.39-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot)
18
18
 
19
19
  Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
20
20
 
21
21
  ### Features
22
- - Easy, **Fast** and **Powerful**
23
- - Fully **asynchronous**
24
- - **Decorator** based update handler
25
- - **Bound** methods
26
- - Supports **userbots**, **Plugins**, [**Filters**](https://github.com/pytdbot/client/blob/ad33d05d3e48bc8842b3986613ad2d99480a1fa8/pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) functions and much more.
22
+
23
+ ``Pytdbot`` offers numerous advantages, including:
24
+
25
+ - **Easy to Use**: Designed with simplicity in mind, making it accessible for developers
26
+ - **Performance**: Fast and powerful, making it ready to fight
27
+ - **Asynchronous**: Fully asynchronous that allows for non-blocking requests and improved responsiveness
28
+ - **Scalable**: Easily scalable using [TDLib Server](https://github.com/pytdbot/tdlib-server)
29
+ - **Well-typed**: Provides clear and well-defined methods and types to enhance developer experience
30
+ - **Decorator-Based Updates**: Simplifies the implementation of update handlers through a decorator pattern
31
+ - **Bound Methods**: Features types bound methods for improved usability
32
+ - **Unlimited Support**: Supports **Plugins**, [**filters**](pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) types/functions and much more
33
+
27
34
 
28
35
 
29
36
  ### Requirements
@@ -32,6 +39,7 @@ Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/t
32
39
  - Telegram [API key](https://my.telegram.org/apps)
33
40
  - [tdjson](https://github.com/tdlib/td#building)
34
41
  - [deepdiff](https://github.com/seperman/deepdiff)
42
+ - [aio-pika](https://github.com/mosquito/aio-pika)
35
43
 
36
44
  ### Installation
37
45
  > For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).
@@ -49,41 +57,35 @@ pip install git+https://github.com/pytdbot/client.git
49
57
  Basic example:
50
58
  ```python
51
59
 
52
- from pytdbot import Client, utils
53
- from pytdbot.types import LogStreamFile, Update
60
+ import asyncio
61
+
62
+ from pytdbot import Client, types
54
63
 
55
64
  client = Client(
65
+ token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
56
66
  api_id=0,
57
67
  api_hash="API_HASH",
58
- database_encryption_key="1234echobot$",
59
- token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
60
- files_directory="BotDB", # Path where to store TDLib files
61
68
  lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
62
- td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path
69
+ files_directory="BotDB", # Path where to store TDLib files
70
+ database_encryption_key="1234echobot$",
63
71
  td_verbosity=2, # TDLib verbosity level
72
+ td_log=types.LogStreamFile("tdlib.log", 104857600), # Set TDLib log file path
64
73
  )
65
74
 
66
75
 
67
76
  @client.on_updateNewMessage()
68
- async def print_message(c: Client, message: Update):
77
+ async def print_message(c: Client, message: types.UpdateNewMessage):
69
78
  print(message)
70
79
 
71
80
 
72
- @client.on_updateNewMessage()
73
- async def simple_message(c: Client, message: Update):
74
- if message.is_private:
75
- await message.reply_text('Hi! i am simple bot')
76
-
77
- if message.is_self and message.text: # Works only for userbots.
78
- if message.text == "!id":
79
- await message.edit_text(
80
- "\\- Current chat ID: {}\n\\- {} ID: {}".format(
81
- utils.code(str(message.chat_id)),
82
- utils.bold(c.me["first_name"]),
83
- utils.code(str(message.from_id)),
84
- ),
85
- parse_mode="markdownv2",
86
- )
81
+ @client.on_message()
82
+ async def say_hello(c: Client, message: types.Message):
83
+ msg = await message.reply_text(f"Hey {await message.mention(parse_mode='html')}! I'm cooking up a surprise... 🍳👨‍🍳", parse_mode="html")
84
+
85
+ async with message.action("choose_sticker"):
86
+ await asyncio.sleep(5)
87
+
88
+ await msg.edit_text("Boo! 👻 Just kidding.")
87
89
 
88
90
 
89
91
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Pytdbot
3
- Version: 0.8.8.dev0
3
+ Version: 0.9.0.dev2
4
4
  Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
5
  Home-page: https://github.com/pytdbot/client
6
6
  Author: AYMEN Mohammed
@@ -14,16 +14,23 @@ Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
 
17
- # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.22-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot)
17
+ # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.39-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot)
18
18
 
19
19
  Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
20
20
 
21
21
  ### Features
22
- - Easy, **Fast** and **Powerful**
23
- - Fully **asynchronous**
24
- - **Decorator** based update handler
25
- - **Bound** methods
26
- - Supports **userbots**, **Plugins**, [**Filters**](https://github.com/pytdbot/client/blob/ad33d05d3e48bc8842b3986613ad2d99480a1fa8/pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) functions and much more.
22
+
23
+ ``Pytdbot`` offers numerous advantages, including:
24
+
25
+ - **Easy to Use**: Designed with simplicity in mind, making it accessible for developers
26
+ - **Performance**: Fast and powerful, making it ready to fight
27
+ - **Asynchronous**: Fully asynchronous that allows for non-blocking requests and improved responsiveness
28
+ - **Scalable**: Easily scalable using [TDLib Server](https://github.com/pytdbot/tdlib-server)
29
+ - **Well-typed**: Provides clear and well-defined methods and types to enhance developer experience
30
+ - **Decorator-Based Updates**: Simplifies the implementation of update handlers through a decorator pattern
31
+ - **Bound Methods**: Features types bound methods for improved usability
32
+ - **Unlimited Support**: Supports **Plugins**, [**filters**](pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) types/functions and much more
33
+
27
34
 
28
35
 
29
36
  ### Requirements
@@ -32,6 +39,7 @@ Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/t
32
39
  - Telegram [API key](https://my.telegram.org/apps)
33
40
  - [tdjson](https://github.com/tdlib/td#building)
34
41
  - [deepdiff](https://github.com/seperman/deepdiff)
42
+ - [aio-pika](https://github.com/mosquito/aio-pika)
35
43
 
36
44
  ### Installation
37
45
  > For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).
@@ -49,41 +57,35 @@ pip install git+https://github.com/pytdbot/client.git
49
57
  Basic example:
50
58
  ```python
51
59
 
52
- from pytdbot import Client, utils
53
- from pytdbot.types import LogStreamFile, Update
60
+ import asyncio
61
+
62
+ from pytdbot import Client, types
54
63
 
55
64
  client = Client(
65
+ token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
56
66
  api_id=0,
57
67
  api_hash="API_HASH",
58
- database_encryption_key="1234echobot$",
59
- token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
60
- files_directory="BotDB", # Path where to store TDLib files
61
68
  lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
62
- td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path
69
+ files_directory="BotDB", # Path where to store TDLib files
70
+ database_encryption_key="1234echobot$",
63
71
  td_verbosity=2, # TDLib verbosity level
72
+ td_log=types.LogStreamFile("tdlib.log", 104857600), # Set TDLib log file path
64
73
  )
65
74
 
66
75
 
67
76
  @client.on_updateNewMessage()
68
- async def print_message(c: Client, message: Update):
77
+ async def print_message(c: Client, message: types.UpdateNewMessage):
69
78
  print(message)
70
79
 
71
80
 
72
- @client.on_updateNewMessage()
73
- async def simple_message(c: Client, message: Update):
74
- if message.is_private:
75
- await message.reply_text('Hi! i am simple bot')
76
-
77
- if message.is_self and message.text: # Works only for userbots.
78
- if message.text == "!id":
79
- await message.edit_text(
80
- "\\- Current chat ID: {}\n\\- {} ID: {}".format(
81
- utils.code(str(message.chat_id)),
82
- utils.bold(c.me["first_name"]),
83
- utils.code(str(message.from_id)),
84
- ),
85
- parse_mode="markdownv2",
86
- )
81
+ @client.on_message()
82
+ async def say_hello(c: Client, message: types.Message):
83
+ msg = await message.reply_text(f"Hey {await message.mention(parse_mode='html')}! I'm cooking up a surprise... 🍳👨‍🍳", parse_mode="html")
84
+
85
+ async with message.action("choose_sticker"):
86
+ await asyncio.sleep(5)
87
+
88
+ await msg.edit_text("Boo! 👻 Just kidding.")
87
89
 
88
90
 
89
91
 
@@ -0,0 +1,37 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ requirements.txt
5
+ setup.py
6
+ Pytdbot.egg-info/PKG-INFO
7
+ Pytdbot.egg-info/SOURCES.txt
8
+ Pytdbot.egg-info/dependency_links.txt
9
+ Pytdbot.egg-info/requires.txt
10
+ Pytdbot.egg-info/top_level.txt
11
+ pytdbot/__init__.py
12
+ pytdbot/client.py
13
+ pytdbot/filters.py
14
+ pytdbot/exception/__init__.py
15
+ pytdbot/handlers/__init__.py
16
+ pytdbot/handlers/decorators.py
17
+ pytdbot/handlers/handler.py
18
+ pytdbot/handlers/td_updates.py
19
+ pytdbot/methods/__init__.py
20
+ pytdbot/methods/methods.py
21
+ pytdbot/methods/td_functions.py
22
+ pytdbot/tdjson/__init__.py
23
+ pytdbot/tdjson/tdjson.py
24
+ pytdbot/types/__init__.py
25
+ pytdbot/types/plugins/__init__.py
26
+ pytdbot/types/td_types/__init__.py
27
+ pytdbot/types/td_types/types.py
28
+ pytdbot/types/td_types/bound_methods/__init__.py
29
+ pytdbot/types/td_types/bound_methods/chatActions.py
30
+ pytdbot/types/td_types/bound_methods/file.py
31
+ pytdbot/types/td_types/bound_methods/message.py
32
+ pytdbot/utils/__init__.py
33
+ pytdbot/utils/escape.py
34
+ pytdbot/utils/json_utils.py
35
+ pytdbot/utils/obj_encoder.py
36
+ pytdbot/utils/strings.py
37
+ pytdbot/utils/text_format.py
@@ -1,13 +1,20 @@
1
- # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.22-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot)
1
+ # Pytdbot [![Version](https://img.shields.io/pypi/v/Pytdbot?style=flat&logo=pypi)](https://pypi.org/project/Pytdbot) [![TDLib version](https://img.shields.io/badge/TDLib-v1.8.39-blue?logo=telegram)](https://github.com/tdlib/td) [![Downloads](https://static.pepy.tech/personalized-badge/pytdbot?period=month&units=none&left_color=grey&right_color=brightgreen&left_text=Downloads)](https://pepy.tech/project/pytdbot)
2
2
 
3
3
  Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
4
4
 
5
5
  ### Features
6
- - Easy, **Fast** and **Powerful**
7
- - Fully **asynchronous**
8
- - **Decorator** based update handler
9
- - **Bound** methods
10
- - Supports **userbots**, **Plugins**, [**Filters**](https://github.com/pytdbot/client/blob/ad33d05d3e48bc8842b3986613ad2d99480a1fa8/pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) functions and much more.
6
+
7
+ ``Pytdbot`` offers numerous advantages, including:
8
+
9
+ - **Easy to Use**: Designed with simplicity in mind, making it accessible for developers
10
+ - **Performance**: Fast and powerful, making it ready to fight
11
+ - **Asynchronous**: Fully asynchronous that allows for non-blocking requests and improved responsiveness
12
+ - **Scalable**: Easily scalable using [TDLib Server](https://github.com/pytdbot/tdlib-server)
13
+ - **Well-typed**: Provides clear and well-defined methods and types to enhance developer experience
14
+ - **Decorator-Based Updates**: Simplifies the implementation of update handlers through a decorator pattern
15
+ - **Bound Methods**: Features types bound methods for improved usability
16
+ - **Unlimited Support**: Supports **Plugins**, [**filters**](pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) types/functions and much more
17
+
11
18
 
12
19
 
13
20
  ### Requirements
@@ -16,6 +23,7 @@ Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/t
16
23
  - Telegram [API key](https://my.telegram.org/apps)
17
24
  - [tdjson](https://github.com/tdlib/td#building)
18
25
  - [deepdiff](https://github.com/seperman/deepdiff)
26
+ - [aio-pika](https://github.com/mosquito/aio-pika)
19
27
 
20
28
  ### Installation
21
29
  > For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).
@@ -33,41 +41,35 @@ pip install git+https://github.com/pytdbot/client.git
33
41
  Basic example:
34
42
  ```python
35
43
 
36
- from pytdbot import Client, utils
37
- from pytdbot.types import LogStreamFile, Update
44
+ import asyncio
45
+
46
+ from pytdbot import Client, types
38
47
 
39
48
  client = Client(
49
+ token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
40
50
  api_id=0,
41
51
  api_hash="API_HASH",
42
- database_encryption_key="1234echobot$",
43
- token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
44
- files_directory="BotDB", # Path where to store TDLib files
45
52
  lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
46
- td_log=LogStreamFile("tdlib.log"), # Set TDLib log file path
53
+ files_directory="BotDB", # Path where to store TDLib files
54
+ database_encryption_key="1234echobot$",
47
55
  td_verbosity=2, # TDLib verbosity level
56
+ td_log=types.LogStreamFile("tdlib.log", 104857600), # Set TDLib log file path
48
57
  )
49
58
 
50
59
 
51
60
  @client.on_updateNewMessage()
52
- async def print_message(c: Client, message: Update):
61
+ async def print_message(c: Client, message: types.UpdateNewMessage):
53
62
  print(message)
54
63
 
55
64
 
56
- @client.on_updateNewMessage()
57
- async def simple_message(c: Client, message: Update):
58
- if message.is_private:
59
- await message.reply_text('Hi! i am simple bot')
60
-
61
- if message.is_self and message.text: # Works only for userbots.
62
- if message.text == "!id":
63
- await message.edit_text(
64
- "\\- Current chat ID: {}\n\\- {} ID: {}".format(
65
- utils.code(str(message.chat_id)),
66
- utils.bold(c.me["first_name"]),
67
- utils.code(str(message.from_id)),
68
- ),
69
- parse_mode="markdownv2",
70
- )
65
+ @client.on_message()
66
+ async def say_hello(c: Client, message: types.Message):
67
+ msg = await message.reply_text(f"Hey {await message.mention(parse_mode='html')}! I'm cooking up a surprise... 🍳👨‍🍳", parse_mode="html")
68
+
69
+ async with message.action("choose_sticker"):
70
+ await asyncio.sleep(5)
71
+
72
+ await msg.edit_text("Boo! 👻 Just kidding.")
71
73
 
72
74
 
73
75
 
@@ -2,8 +2,10 @@ from . import types, utils, filters, exception
2
2
  from .tdjson import TdJson
3
3
  from .client import Client
4
4
 
5
- __version__ = "0.8.8dev0"
6
- __copyright__ = "Copyright (c) 2022-2023 AYMEN Mohammed ~ https://github.com/AYMENJD"
5
+ __all__ = ["types", "utils", "filters", "exception", "TdJson", "Client"]
6
+
7
+ __version__ = "0.9.0dev2"
8
+ __copyright__ = "Copyright (c) 2022-2024 AYMEN Mohammed ~ https://github.com/AYMENJD"
7
9
  __license__ = "MIT License"
8
10
 
9
11
  VERSION = __version__