Pytdbot 0.8.8.dev0__tar.gz → 0.9.0__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 (81) hide show
  1. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/LICENSE +1 -1
  2. pytdbot-0.9.0/PKG-INFO +134 -0
  3. pytdbot-0.9.0/Pytdbot.egg-info/PKG-INFO +134 -0
  4. pytdbot-0.9.0/Pytdbot.egg-info/SOURCES.txt +39 -0
  5. pytdbot-0.9.0/Pytdbot.egg-info/requires.txt +5 -0
  6. pytdbot-0.9.0/README.md +103 -0
  7. pytdbot-0.9.0/pytdbot/__init__.py +11 -0
  8. pytdbot-0.9.0/pytdbot/client.py +1090 -0
  9. pytdbot-0.9.0/pytdbot/exception/__init__.py +31 -0
  10. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/filters.py +4 -3
  11. pytdbot-0.9.0/pytdbot/handlers/decorators.py +135 -0
  12. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/handlers/handler.py +4 -2
  13. Pytdbot-0.8.8.dev0/pytdbot/handlers/updates.py → pytdbot-0.9.0/pytdbot/handlers/td_updates.py +1663 -536
  14. pytdbot-0.9.0/pytdbot/methods/methods.py +1410 -0
  15. pytdbot-0.9.0/pytdbot/methods/td_functions.py +19028 -0
  16. pytdbot-0.9.0/pytdbot/tdjson/tdjson.py +151 -0
  17. pytdbot-0.9.0/pytdbot/types/__init__.py +3751 -0
  18. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/types/plugins/__init__.py +1 -1
  19. pytdbot-0.9.0/pytdbot/types/td_types/__init__.py +1 -0
  20. pytdbot-0.9.0/pytdbot/types/td_types/bound_methods/__init__.py +4 -0
  21. pytdbot-0.9.0/pytdbot/types/td_types/bound_methods/callback_query.py +110 -0
  22. {Pytdbot-0.8.8.dev0/pytdbot/types/update → pytdbot-0.9.0/pytdbot/types/td_types/bound_methods}/chatActions.py +50 -17
  23. pytdbot-0.9.0/pytdbot/types/td_types/bound_methods/file.py +35 -0
  24. pytdbot-0.9.0/pytdbot/types/td_types/bound_methods/message.py +852 -0
  25. pytdbot-0.9.0/pytdbot/types/td_types/types.py +83026 -0
  26. pytdbot-0.9.0/pytdbot/utils/__init__.py +53 -0
  27. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/utils/escape.py +5 -4
  28. pytdbot-0.9.0/pytdbot/utils/json_utils.py +27 -0
  29. pytdbot-0.9.0/pytdbot/utils/obj_encoder.py +38 -0
  30. pytdbot-0.9.0/pytdbot/utils/strings.py +52 -0
  31. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/utils/text_format.py +81 -55
  32. pytdbot-0.9.0/pytdbot/utils/webapps.py +81 -0
  33. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/requirements.txt +1 -0
  34. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/setup.py +4 -1
  35. Pytdbot-0.8.8.dev0/PKG-INFO +0 -104
  36. Pytdbot-0.8.8.dev0/Pytdbot.egg-info/PKG-INFO +0 -104
  37. Pytdbot-0.8.8.dev0/Pytdbot.egg-info/SOURCES.txt +0 -55
  38. Pytdbot-0.8.8.dev0/Pytdbot.egg-info/requires.txt +0 -1
  39. Pytdbot-0.8.8.dev0/README.md +0 -86
  40. Pytdbot-0.8.8.dev0/pytdbot/__init__.py +0 -9
  41. Pytdbot-0.8.8.dev0/pytdbot/client.py +0 -1148
  42. Pytdbot-0.8.8.dev0/pytdbot/exception/__init__.py +0 -13
  43. Pytdbot-0.8.8.dev0/pytdbot/generate_files.py +0 -145
  44. Pytdbot-0.8.8.dev0/pytdbot/generate_json.py +0 -92
  45. Pytdbot-0.8.8.dev0/pytdbot/handlers/decorators.py +0 -82
  46. Pytdbot-0.8.8.dev0/pytdbot/methods/methods.py +0 -1789
  47. Pytdbot-0.8.8.dev0/pytdbot/methods/tdlibfunctions.py +0 -15841
  48. Pytdbot-0.8.8.dev0/pytdbot/td_api.json +0 -32715
  49. Pytdbot-0.8.8.dev0/pytdbot/td_api.tl +0 -9655
  50. Pytdbot-0.8.8.dev0/pytdbot/tdjson/tdjson.py +0 -142
  51. Pytdbot-0.8.8.dev0/pytdbot/types/__init__.py +0 -45
  52. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/__init__.py +0 -15
  53. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/base.py +0 -4
  54. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/force_reply.py +0 -33
  55. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/inline_keyboard.py +0 -228
  56. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/remove_keyboard.py +0 -25
  57. Pytdbot-0.8.8.dev0/pytdbot/types/buttons/show_keyboard.py +0 -254
  58. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/__init__.py +0 -15
  59. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/base.py +0 -6
  60. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_generated.py +0 -39
  61. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_id.py +0 -14
  62. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_local.py +0 -21
  63. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_file_remote.py +0 -14
  64. Pytdbot-0.8.8.dev0/pytdbot/types/inputfile/input_thumbnail.py +0 -29
  65. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/__init__.py +0 -7
  66. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/base.py +0 -8
  67. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/log_stream_default.py +0 -8
  68. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/log_stream_empty.py +0 -8
  69. Pytdbot-0.8.8.dev0/pytdbot/types/logstream/log_stream_file.py +0 -40
  70. Pytdbot-0.8.8.dev0/pytdbot/types/result/__init__.py +0 -3
  71. Pytdbot-0.8.8.dev0/pytdbot/types/result/result.py +0 -100
  72. Pytdbot-0.8.8.dev0/pytdbot/types/update/__init__.py +0 -4
  73. Pytdbot-0.8.8.dev0/pytdbot/types/update/update.py +0 -1736
  74. Pytdbot-0.8.8.dev0/pytdbot/utils/__init__.py +0 -28
  75. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/MANIFEST.in +0 -0
  76. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/Pytdbot.egg-info/dependency_links.txt +0 -0
  77. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/Pytdbot.egg-info/top_level.txt +0 -0
  78. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/handlers/__init__.py +0 -0
  79. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/methods/__init__.py +0 -0
  80. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/pytdbot/tdjson/__init__.py +0 -0
  81. {Pytdbot-0.8.8.dev0 → pytdbot-0.9.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2022-2023 Python TDLib
3
+ Copyright (c) 2022-2025 Pytdbot, AYMENJD
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
pytdbot-0.9.0/PKG-INFO ADDED
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.2
2
+ Name: Pytdbot
3
+ Version: 0.9.0
4
+ Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
+ Home-page: https://github.com/pytdbot/client
6
+ Author: AYMEN Mohammed
7
+ Author-email: let.me.code.safe@gmail.com
8
+ License: MIT
9
+ Project-URL: Source, https://github.com/pytdbot/client
10
+ Project-URL: Tracker, https://github.com/pytdbot/client/issues
11
+ Keywords: telegram,tdlib,bot,telegram-client,telegram-bot,bot-api,telegram-bot,tdlib-python,tdlib-bot
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: deepdiff
16
+ Requires-Dist: aio-pika
17
+ Provides-Extra: tdjson
18
+ Requires-Dist: tdjson; extra == "tdjson"
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: keywords
25
+ Dynamic: license
26
+ Dynamic: project-url
27
+ Dynamic: provides-extra
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # 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.45-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)
33
+
34
+ Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
35
+
36
+ ### Features
37
+
38
+ `Pytdbot` offers numerous advantages, including:
39
+
40
+ - **Easy to Use**: Designed with simplicity in mind, making it accessible for developers
41
+ - **Performance**: Fast and powerful, making it ready to fight
42
+ - **Asynchronous**: Fully asynchronous that allows for non-blocking requests and improved responsiveness
43
+ - **Scalable**: Easily scalable using [TDLib Server](https://github.com/pytdbot/tdlib-server)
44
+ - **Well-typed**: Provides clear and well-defined methods and types to enhance developer experience
45
+ - **Decorator-Based Updates**: Simplifies the implementation of update handlers through a decorator pattern
46
+ - **Bound Methods**: Features types bound methods for improved usability
47
+ - **Unlimited Support**: Supports **Plugins**, [**filters**](pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) types/functions and much more
48
+
49
+ ### Requirements
50
+
51
+ - Python 3.9+
52
+ - Telegram [API key](https://my.telegram.org/apps)
53
+ - [tdjson](https://github.com/AYMENJD/tdjson) or [TDLib](https://github.com/tdlib/td#building)
54
+ - [deepdiff](https://github.com/seperman/deepdiff)
55
+ - [aio-pika](https://github.com/mosquito/aio-pika)
56
+
57
+ ### Installation
58
+
59
+ > For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).
60
+
61
+ You can install Pytdbot with TDLib included using pip:
62
+
63
+ ```bash
64
+ pip install pytdbot[tdjson]
65
+ ```
66
+
67
+ or without **pre-built** TDLib:
68
+
69
+ ```bash
70
+ pip install pytdbot
71
+ ```
72
+
73
+ If the install fails, then you need to build TDLib from [source](https://github.com/tdlib/td#building) and pass it to `Client(lib_path="/path/to/libtdjson.so")`.
74
+
75
+ You could also install the development version using the following command:
76
+
77
+ ```bash
78
+ pip install --pre pytdbot
79
+ ```
80
+
81
+ ### Examples
82
+
83
+ Basic example:
84
+
85
+ ```python
86
+
87
+ import asyncio
88
+
89
+ from pytdbot import Client, types
90
+
91
+ client = Client(
92
+ token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
93
+ api_id=0,
94
+ api_hash="API_HASH",
95
+ lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
96
+ files_directory="BotDB", # Path where to store TDLib files
97
+ database_encryption_key="1234echobot$",
98
+ td_verbosity=2, # TDLib verbosity level
99
+ td_log=types.LogStreamFile("tdlib.log", 104857600), # Set TDLib log file path
100
+ )
101
+
102
+
103
+ @client.on_updateNewMessage()
104
+ async def print_message(c: Client, message: types.UpdateNewMessage):
105
+ print(message)
106
+
107
+
108
+ @client.on_message()
109
+ async def say_hello(c: Client, message: types.Message):
110
+ msg = await message.reply_text(f"Hey {await message.mention(parse_mode='html')}! I'm cooking up a surprise... 🍳👨‍🍳", parse_mode="html")
111
+
112
+ async with message.action("choose_sticker"):
113
+ await asyncio.sleep(5)
114
+
115
+ await msg.edit_text("Boo! 👻 Just kidding.")
116
+
117
+
118
+
119
+ # Run the client
120
+ client.run()
121
+
122
+ ```
123
+
124
+ For more examples, check the [examples](https://github.com/pytdbot/client/tree/main/examples) folder.
125
+
126
+ # Thanks to
127
+
128
+ - You for viewing or using this project.
129
+
130
+ - [@levlam](https://github.com/levlam) for maintaining [TDLib](https://github.com/tdlib/td) and for the help to create [Pytdbot](https://github.com/pytdbot/client).
131
+
132
+ # License
133
+
134
+ MIT [License](https://github.com/pytdbot/client/blob/main/LICENSE)
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.2
2
+ Name: Pytdbot
3
+ Version: 0.9.0
4
+ Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
+ Home-page: https://github.com/pytdbot/client
6
+ Author: AYMEN Mohammed
7
+ Author-email: let.me.code.safe@gmail.com
8
+ License: MIT
9
+ Project-URL: Source, https://github.com/pytdbot/client
10
+ Project-URL: Tracker, https://github.com/pytdbot/client/issues
11
+ Keywords: telegram,tdlib,bot,telegram-client,telegram-bot,bot-api,telegram-bot,tdlib-python,tdlib-bot
12
+ Requires-Python: >=3.9
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: deepdiff
16
+ Requires-Dist: aio-pika
17
+ Provides-Extra: tdjson
18
+ Requires-Dist: tdjson; extra == "tdjson"
19
+ Dynamic: author
20
+ Dynamic: author-email
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: keywords
25
+ Dynamic: license
26
+ Dynamic: project-url
27
+ Dynamic: provides-extra
28
+ Dynamic: requires-dist
29
+ Dynamic: requires-python
30
+ Dynamic: summary
31
+
32
+ # 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.45-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)
33
+
34
+ Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
35
+
36
+ ### Features
37
+
38
+ `Pytdbot` offers numerous advantages, including:
39
+
40
+ - **Easy to Use**: Designed with simplicity in mind, making it accessible for developers
41
+ - **Performance**: Fast and powerful, making it ready to fight
42
+ - **Asynchronous**: Fully asynchronous that allows for non-blocking requests and improved responsiveness
43
+ - **Scalable**: Easily scalable using [TDLib Server](https://github.com/pytdbot/tdlib-server)
44
+ - **Well-typed**: Provides clear and well-defined methods and types to enhance developer experience
45
+ - **Decorator-Based Updates**: Simplifies the implementation of update handlers through a decorator pattern
46
+ - **Bound Methods**: Features types bound methods for improved usability
47
+ - **Unlimited Support**: Supports **Plugins**, [**filters**](pytdbot/filters.py#L23), [**TDLib**](https://github.com/tdlib/td) types/functions and much more
48
+
49
+ ### Requirements
50
+
51
+ - Python 3.9+
52
+ - Telegram [API key](https://my.telegram.org/apps)
53
+ - [tdjson](https://github.com/AYMENJD/tdjson) or [TDLib](https://github.com/tdlib/td#building)
54
+ - [deepdiff](https://github.com/seperman/deepdiff)
55
+ - [aio-pika](https://github.com/mosquito/aio-pika)
56
+
57
+ ### Installation
58
+
59
+ > For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).
60
+
61
+ You can install Pytdbot with TDLib included using pip:
62
+
63
+ ```bash
64
+ pip install pytdbot[tdjson]
65
+ ```
66
+
67
+ or without **pre-built** TDLib:
68
+
69
+ ```bash
70
+ pip install pytdbot
71
+ ```
72
+
73
+ If the install fails, then you need to build TDLib from [source](https://github.com/tdlib/td#building) and pass it to `Client(lib_path="/path/to/libtdjson.so")`.
74
+
75
+ You could also install the development version using the following command:
76
+
77
+ ```bash
78
+ pip install --pre pytdbot
79
+ ```
80
+
81
+ ### Examples
82
+
83
+ Basic example:
84
+
85
+ ```python
86
+
87
+ import asyncio
88
+
89
+ from pytdbot import Client, types
90
+
91
+ client = Client(
92
+ token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
93
+ api_id=0,
94
+ api_hash="API_HASH",
95
+ lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
96
+ files_directory="BotDB", # Path where to store TDLib files
97
+ database_encryption_key="1234echobot$",
98
+ td_verbosity=2, # TDLib verbosity level
99
+ td_log=types.LogStreamFile("tdlib.log", 104857600), # Set TDLib log file path
100
+ )
101
+
102
+
103
+ @client.on_updateNewMessage()
104
+ async def print_message(c: Client, message: types.UpdateNewMessage):
105
+ print(message)
106
+
107
+
108
+ @client.on_message()
109
+ async def say_hello(c: Client, message: types.Message):
110
+ msg = await message.reply_text(f"Hey {await message.mention(parse_mode='html')}! I'm cooking up a surprise... 🍳👨‍🍳", parse_mode="html")
111
+
112
+ async with message.action("choose_sticker"):
113
+ await asyncio.sleep(5)
114
+
115
+ await msg.edit_text("Boo! 👻 Just kidding.")
116
+
117
+
118
+
119
+ # Run the client
120
+ client.run()
121
+
122
+ ```
123
+
124
+ For more examples, check the [examples](https://github.com/pytdbot/client/tree/main/examples) folder.
125
+
126
+ # Thanks to
127
+
128
+ - You for viewing or using this project.
129
+
130
+ - [@levlam](https://github.com/levlam) for maintaining [TDLib](https://github.com/tdlib/td) and for the help to create [Pytdbot](https://github.com/pytdbot/client).
131
+
132
+ # License
133
+
134
+ MIT [License](https://github.com/pytdbot/client/blob/main/LICENSE)
@@ -0,0 +1,39 @@
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/callback_query.py
30
+ pytdbot/types/td_types/bound_methods/chatActions.py
31
+ pytdbot/types/td_types/bound_methods/file.py
32
+ pytdbot/types/td_types/bound_methods/message.py
33
+ pytdbot/utils/__init__.py
34
+ pytdbot/utils/escape.py
35
+ pytdbot/utils/json_utils.py
36
+ pytdbot/utils/obj_encoder.py
37
+ pytdbot/utils/strings.py
38
+ pytdbot/utils/text_format.py
39
+ pytdbot/utils/webapps.py
@@ -0,0 +1,5 @@
1
+ deepdiff
2
+ aio-pika
3
+
4
+ [tdjson]
5
+ tdjson
@@ -0,0 +1,103 @@
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.45-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
+
3
+ Pytdbot (Python TDLib) is an asynchronous [**TDLib**](https://github.com/tdlib/td) wrapper for **Telegram** users/bots written in **Python**.
4
+
5
+ ### Features
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
+
18
+ ### Requirements
19
+
20
+ - Python 3.9+
21
+ - Telegram [API key](https://my.telegram.org/apps)
22
+ - [tdjson](https://github.com/AYMENJD/tdjson) or [TDLib](https://github.com/tdlib/td#building)
23
+ - [deepdiff](https://github.com/seperman/deepdiff)
24
+ - [aio-pika](https://github.com/mosquito/aio-pika)
25
+
26
+ ### Installation
27
+
28
+ > For better performance, it's recommended to install [orjson](https://github.com/ijl/orjson#install) or [ujson](https://github.com/ultrajson/ultrajson#ultrajson).
29
+
30
+ You can install Pytdbot with TDLib included using pip:
31
+
32
+ ```bash
33
+ pip install pytdbot[tdjson]
34
+ ```
35
+
36
+ or without **pre-built** TDLib:
37
+
38
+ ```bash
39
+ pip install pytdbot
40
+ ```
41
+
42
+ If the install fails, then you need to build TDLib from [source](https://github.com/tdlib/td#building) and pass it to `Client(lib_path="/path/to/libtdjson.so")`.
43
+
44
+ You could also install the development version using the following command:
45
+
46
+ ```bash
47
+ pip install --pre pytdbot
48
+ ```
49
+
50
+ ### Examples
51
+
52
+ Basic example:
53
+
54
+ ```python
55
+
56
+ import asyncio
57
+
58
+ from pytdbot import Client, types
59
+
60
+ client = Client(
61
+ token="1088394097:AAQX2DnWiw4ihwiJUhIHOGog8gGOI", # Your bot token or phone number if you want to login as user
62
+ api_id=0,
63
+ api_hash="API_HASH",
64
+ lib_path="/path/to/libtdjson.so", # Path to TDjson shared library
65
+ files_directory="BotDB", # Path where to store TDLib files
66
+ database_encryption_key="1234echobot$",
67
+ td_verbosity=2, # TDLib verbosity level
68
+ td_log=types.LogStreamFile("tdlib.log", 104857600), # Set TDLib log file path
69
+ )
70
+
71
+
72
+ @client.on_updateNewMessage()
73
+ async def print_message(c: Client, message: types.UpdateNewMessage):
74
+ print(message)
75
+
76
+
77
+ @client.on_message()
78
+ async def say_hello(c: Client, message: types.Message):
79
+ msg = await message.reply_text(f"Hey {await message.mention(parse_mode='html')}! I'm cooking up a surprise... 🍳👨‍🍳", parse_mode="html")
80
+
81
+ async with message.action("choose_sticker"):
82
+ await asyncio.sleep(5)
83
+
84
+ await msg.edit_text("Boo! 👻 Just kidding.")
85
+
86
+
87
+
88
+ # Run the client
89
+ client.run()
90
+
91
+ ```
92
+
93
+ For more examples, check the [examples](https://github.com/pytdbot/client/tree/main/examples) folder.
94
+
95
+ # Thanks to
96
+
97
+ - You for viewing or using this project.
98
+
99
+ - [@levlam](https://github.com/levlam) for maintaining [TDLib](https://github.com/tdlib/td) and for the help to create [Pytdbot](https://github.com/pytdbot/client).
100
+
101
+ # License
102
+
103
+ MIT [License](https://github.com/pytdbot/client/blob/main/LICENSE)
@@ -0,0 +1,11 @@
1
+ from . import types, utils, filters, exception
2
+ from .tdjson import TdJson
3
+ from .client import Client
4
+
5
+ __all__ = ["types", "utils", "filters", "exception", "TdJson", "Client"]
6
+
7
+ __version__ = "0.9.0"
8
+ __copyright__ = "Copyright (c) 2022-2025 Pytdbot, AYMENJD"
9
+ __license__ = "MIT License"
10
+
11
+ VERSION = __version__