mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-09-28 03:45:55 +00:00
fix miss service message for MessageActionChatJoinedByRequest (#48)
* fix miss service message for MessageActionChatJoinedByRequest Closes #47 --------- Co-authored-by: KurimuzonAkuma <31959970+KurimuzonAkuma@users.noreply.github.com>
This commit is contained in:
parent
9342bdfdd1
commit
2b53d394d2
@ -107,3 +107,6 @@ class MessageServiceType(AutoName):
|
|||||||
|
|
||||||
BOOST_APPLY = auto()
|
BOOST_APPLY = auto()
|
||||||
"Boost apply"
|
"Boost apply"
|
||||||
|
|
||||||
|
JOIN_REQUEST_APPROVED = auto()
|
||||||
|
"Join request approved"
|
||||||
|
@ -372,6 +372,9 @@ class Message(Object, Update):
|
|||||||
boosts_applied (``int``, *optional*):
|
boosts_applied (``int``, *optional*):
|
||||||
Service message: how many boosts were applied.
|
Service message: how many boosts were applied.
|
||||||
|
|
||||||
|
join_request_approved (``bool``, *optional*):
|
||||||
|
Service message: user join request approved
|
||||||
|
|
||||||
business_connection_id (``str``, *optional*):
|
business_connection_id (``str``, *optional*):
|
||||||
Unique identifier of the business connection from which the message was received.
|
Unique identifier of the business connection from which the message was received.
|
||||||
If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
|
If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
|
||||||
@ -489,6 +492,7 @@ class Message(Object, Update):
|
|||||||
giveaway_launched: bool = None,
|
giveaway_launched: bool = None,
|
||||||
chat_ttl_period: int = None,
|
chat_ttl_period: int = None,
|
||||||
boosts_applied: int = None,
|
boosts_applied: int = None,
|
||||||
|
join_request_approved: bool = None,
|
||||||
business_connection_id: str = None,
|
business_connection_id: str = None,
|
||||||
reply_markup: Union[
|
reply_markup: Union[
|
||||||
"types.InlineKeyboardMarkup",
|
"types.InlineKeyboardMarkup",
|
||||||
@ -595,6 +599,7 @@ class Message(Object, Update):
|
|||||||
self.giveaway_launched = giveaway_launched
|
self.giveaway_launched = giveaway_launched
|
||||||
self.chat_ttl_period = chat_ttl_period
|
self.chat_ttl_period = chat_ttl_period
|
||||||
self.boosts_applied = boosts_applied
|
self.boosts_applied = boosts_applied
|
||||||
|
self.join_request_approved = join_request_approved
|
||||||
self.reactions = reactions
|
self.reactions = reactions
|
||||||
self.raw = raw
|
self.raw = raw
|
||||||
|
|
||||||
@ -669,6 +674,7 @@ class Message(Object, Update):
|
|||||||
requested_chats = None
|
requested_chats = None
|
||||||
chat_ttl_period = None
|
chat_ttl_period = None
|
||||||
boosts_applied = None
|
boosts_applied = None
|
||||||
|
join_request_approved = None
|
||||||
|
|
||||||
service_type = None
|
service_type = None
|
||||||
|
|
||||||
@ -756,6 +762,9 @@ class Message(Object, Update):
|
|||||||
elif isinstance(action, raw.types.MessageActionBoostApply):
|
elif isinstance(action, raw.types.MessageActionBoostApply):
|
||||||
boosts_applied = action.boosts
|
boosts_applied = action.boosts
|
||||||
service_type = enums.MessageServiceType.BOOST_APPLY
|
service_type = enums.MessageServiceType.BOOST_APPLY
|
||||||
|
elif isinstance(action, raw.types.MessageActionChatJoinedByRequest):
|
||||||
|
join_request_approved = True
|
||||||
|
service_type = enums.MessageServiceType.JOIN_REQUEST_APPROVED
|
||||||
|
|
||||||
from_user = types.User._parse(client, users.get(user_id, None))
|
from_user = types.User._parse(client, users.get(user_id, None))
|
||||||
sender_chat = types.Chat._parse(client, message, users, chats, is_chat=False) if not from_user else None
|
sender_chat = types.Chat._parse(client, message, users, chats, is_chat=False) if not from_user else None
|
||||||
@ -794,6 +803,7 @@ class Message(Object, Update):
|
|||||||
requested_chats=requested_chats,
|
requested_chats=requested_chats,
|
||||||
chat_ttl_period=chat_ttl_period,
|
chat_ttl_period=chat_ttl_period,
|
||||||
boosts_applied=boosts_applied,
|
boosts_applied=boosts_applied,
|
||||||
|
join_request_approved=join_request_approved,
|
||||||
business_connection_id=business_connection_id,
|
business_connection_id=business_connection_id,
|
||||||
raw=message,
|
raw=message,
|
||||||
client=client
|
client=client
|
||||||
|
Loading…
Reference in New Issue
Block a user