-
-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing tests and content types for Telegram Bot API 7.2 update #1453
Fixing tests and content types for Telegram Bot API 7.2 update #1453
Conversation
✔️ Changelog found.Thank you for adding a description of the changes |
|
@@ -238,6 +239,8 @@ class Message(MaybeInaccessibleMessage): | |||
"""*Optional*. Message is an invoice for a `payment <https://core.telegram.org/bots/api#payments>`_, information about the invoice. `More about payments » <https://core.telegram.org/bots/api#payments>`_""" | |||
successful_payment: Optional[SuccessfulPayment] = None | |||
"""*Optional*. Message is a service message about a successful payment, information about the payment. `More about payments » <https://core.telegram.org/bots/api#payments>`_""" | |||
shared_user: Optional[SharedUser] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTF is this?
@@ -628,6 +633,12 @@ def content_type(self) -> str: | |||
return ContentType.WRITE_ACCESS_ALLOWED | |||
if self.boost_added: | |||
return ContentType.BOOST_ADDED | |||
if self.business_connection_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not event type.
@@ -628,6 +633,12 @@ def content_type(self) -> str: | |||
return ContentType.WRITE_ACCESS_ALLOWED | |||
if self.boost_added: | |||
return ContentType.BOOST_ADDED | |||
if self.business_connection_id: | |||
return ContentType.BUSINESS_CONNECTION_ID | |||
if self.is_from_offline: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not event type.
return ContentType.BUSINESS_CONNECTION_ID | ||
if self.is_from_offline: | ||
return ContentType.IS_FROM_OFFLINE | ||
if self.sender_business_bot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is not event type.
* Added base support of Bot API 7.2 * Added base support of Bot API 7.2 * Fixing tests and content types for Telegram Bot API 7.2 update (#1453) * Fixing tests and content types for Telegram Bot API 7.2 * Adding changelog for 1453 PR * Fixes + coverage * Replace `BusinessConnection.date` type * Reformat code * Refactor UserContextMiddleware to use EventContext class This update significantly refactors UserContextMiddleware to leverage a new class, EventContext. Instead of resolving event context as a tuple, it now produces an instance of EventContext. Additional adjustments include supporting a business connection ID for event context identification and facilitating backwards compatibility. Tests and other files were also updated accordingly for these changes. * Cover FSM key builder (business_connection_id * Added changelog --------- Co-authored-by: RoLOQ <roman.fedunn@gmail.com>
Description
SHARED_USER
inContentType
enumFixes # (issue)
#1446
Type of change
* InputSticker now requires format as in Telegram Bot API
How Has This Been Tested?
Test Configuration:
Checklist: