mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Bot API 7.10 (#1570)
* Bump to the latest schema * Added full support ob Bot API 7.10 * Add support for purchased paid media events Enhanced the router to include `purchased_paid_media` handling. Added corresponding test cases to verify the new functionality and updated middleware to return the appropriate `EventContext`. * Added changelog
This commit is contained in:
parent
fb1e5cad59
commit
e8fc890809
40 changed files with 487 additions and 106 deletions
|
|
@ -21,7 +21,7 @@ class CreateInvoiceLink(TelegramMethod[str]):
|
|||
description: str
|
||||
"""Product description, 1-255 characters"""
|
||||
payload: str
|
||||
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
||||
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes."""
|
||||
currency: str
|
||||
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
|
||||
prices: List[LabeledPrice]
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class SendInvoice(TelegramMethod[Message]):
|
|||
description: str
|
||||
"""Product description, 1-255 characters"""
|
||||
payload: str
|
||||
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."""
|
||||
"""Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes."""
|
||||
currency: str
|
||||
"""Three-letter ISO 4217 currency code, see `more on currencies <https://core.telegram.org/bots/payments#supported-currencies>`_. Pass 'XTR' for payments in `Telegram Stars <https://t.me/BotNews/90>`_."""
|
||||
prices: List[LabeledPrice]
|
||||
|
|
|
|||
|
|
@ -29,11 +29,13 @@ class SendPaidMedia(TelegramMethod[Message]):
|
|||
chat_id: Union[int, str]
|
||||
"""Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`). If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance."""
|
||||
star_count: int
|
||||
"""The number of Telegram Stars that must be paid to buy access to the media"""
|
||||
"""The number of Telegram Stars that must be paid to buy access to the media; 1-2500"""
|
||||
media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]]
|
||||
"""A JSON-serialized array describing the media to be sent; up to 10 items"""
|
||||
business_connection_id: Optional[str] = None
|
||||
"""Unique identifier of the business connection on behalf of which the message will be sent"""
|
||||
payload: Optional[str] = None
|
||||
"""Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user, use it for your internal processes."""
|
||||
caption: Optional[str] = None
|
||||
"""Media caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = None
|
||||
|
|
@ -64,6 +66,7 @@ class SendPaidMedia(TelegramMethod[Message]):
|
|||
star_count: int,
|
||||
media: List[Union[InputPaidMediaPhoto, InputPaidMediaVideo]],
|
||||
business_connection_id: Optional[str] = None,
|
||||
payload: Optional[str] = None,
|
||||
caption: Optional[str] = None,
|
||||
parse_mode: Optional[str] = None,
|
||||
caption_entities: Optional[List[MessageEntity]] = None,
|
||||
|
|
@ -85,6 +88,7 @@ class SendPaidMedia(TelegramMethod[Message]):
|
|||
star_count=star_count,
|
||||
media=media,
|
||||
business_connection_id=business_connection_id,
|
||||
payload=payload,
|
||||
caption=caption,
|
||||
parse_mode=parse_mode,
|
||||
caption_entities=caption_entities,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue