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.
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/PKG-INFO +1 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/PKG-INFO +1 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/__init__.py +1 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/methods/methods.py +1 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/callback_query.py +1 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/message.py +63 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/td_types.py +6351 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/rich_converter.py +1 -1
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/LICENSE +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/MANIFEST.in +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/SOURCES.txt +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/dependency_links.txt +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/requires.txt +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/Pytdbot.egg-info/top_level.txt +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/README.md +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pyproject.toml +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/client.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/client_manager.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/exception/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/filters.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/decorators.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/handler.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/handlers/td_updates.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/methods/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/methods/td_functions.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/tdjson/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/tdjson/tdjson.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/chatActions.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/file.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/bound_methods/sender_id.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/plugins/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/tdserver/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/tdserver/schedule.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/types/tdserver/stats.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/__init__.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/albums.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/escape.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/json_utils.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/obj_encoder.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/rich_messages.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/strings.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/text_format.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/pytdbot/utils/webapps.py +0 -0
- {pytdbot-0.10.0.post1 → pytdbot-0.10.1.dev0}/setup.cfg +0 -0
|
@@ -1523,7 +1523,7 @@ class Methods(TDLibFunctions):
|
|
|
1523
1523
|
return parse
|
|
1524
1524
|
caption = parse
|
|
1525
1525
|
else:
|
|
1526
|
-
caption = FormattedText(
|
|
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
|
|
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,
|