mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Merge branch 'dev-2.x'
This commit is contained in:
commit
e7aea52e6b
3 changed files with 17 additions and 12 deletions
|
|
@ -43,5 +43,5 @@ __all__ = (
|
|||
'utils',
|
||||
)
|
||||
|
||||
__version__ = '2.11.1'
|
||||
__version__ = '2.11.2'
|
||||
__api_version__ = '5.0'
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
entities = prepare_arg(entities)
|
||||
payload = generate_payload(**locals())
|
||||
if self.parse_mode and entities is not None:
|
||||
if self.parse_mode and entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
result = await self.request(api.Methods.SEND_MESSAGE, payload)
|
||||
|
|
@ -414,7 +414,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals())
|
||||
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
result = await self.request(api.Methods.COPY_MESSAGE, payload)
|
||||
|
|
@ -477,7 +477,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals(), exclude=['photo'])
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
files = {}
|
||||
|
|
@ -562,7 +562,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals(), exclude=['audio', 'thumb'])
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
files = {}
|
||||
|
|
@ -647,7 +647,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals(), exclude=['document'])
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
files = {}
|
||||
|
|
@ -733,7 +733,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals(), exclude=['video', 'thumb'])
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
files = {}
|
||||
|
|
@ -823,7 +823,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals(), exclude=["animation", "thumb"])
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
files = {}
|
||||
|
|
@ -898,7 +898,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals(), exclude=['voice'])
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
files = {}
|
||||
|
|
@ -1425,7 +1425,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
open_period = prepare_arg(open_period)
|
||||
close_date = prepare_arg(close_date)
|
||||
payload = generate_payload(**locals())
|
||||
if self.parse_mode and explanation_entities is not None:
|
||||
if self.parse_mode and explanation_entities is None:
|
||||
payload.setdefault('explanation_parse_mode', self.parse_mode)
|
||||
|
||||
result = await self.request(api.Methods.SEND_POLL, payload)
|
||||
|
|
@ -2210,7 +2210,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
entities = prepare_arg(entities)
|
||||
payload = generate_payload(**locals())
|
||||
if self.parse_mode and entities is not None:
|
||||
if self.parse_mode and entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
result = await self.request(api.Methods.EDIT_MESSAGE_TEXT, payload)
|
||||
|
|
@ -2262,7 +2262,7 @@ class Bot(BaseBot, DataMixin, ContextInstanceMixin):
|
|||
reply_markup = prepare_arg(reply_markup)
|
||||
caption_entities = prepare_arg(caption_entities)
|
||||
payload = generate_payload(**locals())
|
||||
if self.parse_mode and caption_entities is not None:
|
||||
if self.parse_mode and caption_entities is None:
|
||||
payload.setdefault('parse_mode', self.parse_mode)
|
||||
|
||||
result = await self.request(api.Methods.EDIT_MESSAGE_CAPTION, payload)
|
||||
|
|
|
|||
|
|
@ -689,6 +689,7 @@ class Message(base.TelegramObject):
|
|||
caption: typing.Optional[base.String] = None,
|
||||
parse_mode: typing.Optional[base.String] = None,
|
||||
caption_entities: typing.Optional[typing.List[MessageEntity]] = None,
|
||||
supports_streaming: typing.Optional[base.Boolean] = None,
|
||||
disable_notification: typing.Optional[base.Boolean] = None,
|
||||
allow_sending_without_reply: typing.Optional[base.Boolean] = None,
|
||||
reply_markup: typing.Union[
|
||||
|
|
@ -733,6 +734,9 @@ class Message(base.TelegramObject):
|
|||
which can be specified instead of parse_mode
|
||||
:type caption_entities: :obj:`typing.Optional[typing.List[MessageEntity]]`
|
||||
|
||||
:param supports_streaming: Pass True, if the uploaded video is suitable for streaming
|
||||
:type supports_streaming: :obj:`typing.Optional[base.Boolean]`
|
||||
|
||||
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
||||
:type disable_notification: :obj:`typing.Optional[base.Boolean]`
|
||||
|
||||
|
|
@ -761,6 +765,7 @@ class Message(base.TelegramObject):
|
|||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
supports_streaming=supports_streaming,
|
||||
disable_notification=disable_notification,
|
||||
reply_to_message_id=self.message_id if reply else None,
|
||||
allow_sending_without_reply=allow_sending_without_reply,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue