Pytdbot 0.10.0.post1__tar.gz → 0.10.1.dev0__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 (47) hide show
  1. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/PKG-INFO +1 -1
  2. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/PKG-INFO +1 -1
  3. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/__init__.py +1 -1
  4. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/methods/methods.py +1 -1
  5. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/callback_query.py +1 -1
  6. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/message.py +63 -1
  7. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/td_types.py +6351 -0
  8. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/rich_converter.py +1 -1
  9. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/LICENSE +0 -0
  10. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/MANIFEST.in +0 -0
  11. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/SOURCES.txt +0 -0
  12. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/dependency_links.txt +0 -0
  13. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/requires.txt +0 -0
  14. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/top_level.txt +0 -0
  15. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/README.md +0 -0
  16. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pyproject.toml +0 -0
  17. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/client.py +0 -0
  18. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/client_manager.py +0 -0
  19. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/exception/__init__.py +0 -0
  20. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/filters.py +0 -0
  21. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/__init__.py +0 -0
  22. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/decorators.py +0 -0
  23. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/handler.py +0 -0
  24. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/td_updates.py +0 -0
  25. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/methods/__init__.py +0 -0
  26. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/methods/td_functions.py +0 -0
  27. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/tdjson/__init__.py +0 -0
  28. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/tdjson/tdjson.py +0 -0
  29. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/__init__.py +0 -0
  30. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/__init__.py +0 -0
  31. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/chatActions.py +0 -0
  32. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/file.py +0 -0
  33. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/sender_id.py +0 -0
  34. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/plugins/__init__.py +0 -0
  35. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/tdserver/__init__.py +0 -0
  36. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/tdserver/schedule.py +0 -0
  37. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/tdserver/stats.py +0 -0
  38. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/__init__.py +0 -0
  39. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/albums.py +0 -0
  40. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/escape.py +0 -0
  41. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/json_utils.py +0 -0
  42. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/obj_encoder.py +0 -0
  43. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/rich_messages.py +0 -0
  44. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/strings.py +0 -0
  45. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/text_format.py +0 -0
  46. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/webapps.py +0 -0
  47. {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pytdbot
3
- Version: 0.10.0.post1
3
+ Version: 0.10.1.dev0
4
4
  Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
5
  Author-email: AYMEN A <let.me.code.safe@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Pytdbot
3
- Version: 0.10.0.post1
3
+ Version: 0.10.1.dev0
4
4
  Summary: Easy-to-use asynchronous TDLib wrapper for Python.
5
5
  Author-email: AYMEN A <let.me.code.safe@gmail.com>
6
6
  License-Expression: MIT
@@ -13,7 +13,7 @@ __all__ = [
13
13
  "Client",
14
14
  ]
15
15
 
16
- __version__ = "0.10.0.post1"
16
+ __version__ = "0.10.1.dev0"
17
17
  __copyright__ = "Copyright (c) 2022-2026 Pytdbot, AYMENJD"
18
18
  __license__ = "MIT License"
19
19
 
@@ -1523,7 +1523,7 @@ class Methods(TDLibFunctions):
1523
1523
  return parse
1524
1524
  caption = parse
1525
1525
  else:
1526
- caption = FormattedText(id=new_caption)
1526
+ caption = FormattedText(text=new_caption)
1527
1527
 
1528
1528
  return await self.sendMessageWithContent(
1529
1529
  chat_id=chat_id,
@@ -111,7 +111,7 @@ class CallbackQueryBoundMethods:
111
111
  return parse
112
112
  caption = parse
113
113
  else:
114
- caption = pytdbot.types.FormattedText(caption)
114
+ caption = pytdbot.types.FormattedText(text=caption)
115
115
 
116
116
  return await self._client.editMessageCaption(
117
117
  chat_id=self.chat_id,
@@ -84,6 +84,68 @@ class MessageBoundMethods:
84
84
  ):
85
85
  return self.content.caption.entities
86
86
 
87
+ def _get_rich_media(self, block):
88
+ if isinstance(block, pytdbot.types.PageBlockPhoto):
89
+ return block.photo
90
+
91
+ if isinstance(block, pytdbot.types.PageBlockVideo):
92
+ return block.video
93
+
94
+ if isinstance(block, pytdbot.types.PageBlockAudio):
95
+ return block.audio
96
+
97
+ if isinstance(block, pytdbot.types.PageBlockVoiceNote):
98
+ return block.voice_note
99
+
100
+ if isinstance(block, pytdbot.types.PageBlockAnimation):
101
+ return block.animation
102
+
103
+ if isinstance(
104
+ block,
105
+ (pytdbot.types.PageBlockCollage, pytdbot.types.PageBlockSlideshow),
106
+ ):
107
+ media = []
108
+ for child in block.blocks:
109
+ if m := self._get_rich_media(child):
110
+ if isinstance(m, list):
111
+ media.extend(m)
112
+ else:
113
+ media.append(m)
114
+ return media
115
+
116
+ return None
117
+
118
+ @property
119
+ @lru_cache(1)
120
+ def rich_media(
121
+ self,
122
+ ) -> (
123
+ list[
124
+ pytdbot.types.Photo
125
+ | pytdbot.types.Video
126
+ | pytdbot.types.Audio
127
+ | pytdbot.types.VoiceNote
128
+ | pytdbot.types.Animation
129
+ ]
130
+ | None
131
+ ):
132
+ """Returns all media attachments available in the Rich message"""
133
+
134
+ if not isinstance(self.content, pytdbot.types.MessageRichMessage):
135
+ return None
136
+
137
+ media = []
138
+
139
+ for block in self.content.message.blocks:
140
+ item = self._get_rich_media(block)
141
+
142
+ if isinstance(item, list):
143
+ media.extend(item)
144
+ elif item is not None:
145
+ media.append(item)
146
+
147
+ return media or None
148
+
87
149
  @property
88
150
  @lru_cache(1)
89
151
  def remote_file_id(self) -> str | None:
@@ -589,7 +651,7 @@ class MessageBoundMethods:
589
651
  | pytdbot.types.ReplyMarkupRemoveKeyboard
590
652
  | None = None,
591
653
  ) -> pytdbot.types.Error | pytdbot.types.Message:
592
- r"""Reply to the message with rich message. Shortcut for :meth:`~pytdbot.Client.sendRichMessage`."""
654
+ r"""Reply to the message with Rich message. Shortcut for :meth:`~pytdbot.Client.sendRichMessage`."""
593
655
 
594
656
  return await self._client.sendRichMessage(
595
657
  chat_id=self.chat_id,