mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Pyrofork: Add channel_shared and user_shared service message types
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
fc406b8286
commit
6b45a89f2b
2 changed files with 30 additions and 0 deletions
|
|
@ -61,6 +61,12 @@ class MessageServiceType(AutoName):
|
|||
GAME_HIGH_SCORE = auto()
|
||||
"Game high score"
|
||||
|
||||
ChannelShared = auto()
|
||||
"a shared chat/channel"
|
||||
|
||||
UserShared = auto()
|
||||
"a shared user"
|
||||
|
||||
FORUM_TOPIC_CREATED = auto()
|
||||
"a new forum topic created in the chat"
|
||||
|
||||
|
|
|
|||
|
|
@ -294,6 +294,12 @@ class Message(Object, Update):
|
|||
E.g.: "/start 1 2 3" would produce ["start", "1", "2", "3"].
|
||||
Only applicable when using :obj:`~pyrogram.filters.command`.
|
||||
|
||||
channel_shared (``int``, *optional*):
|
||||
Service message: chat/channel shared
|
||||
|
||||
user_shared (``int``, *optional*):
|
||||
Service message: user shared
|
||||
|
||||
forum_topic_created (:obj:`~pyrogram.types.ForumTopicCreated`, *optional*):
|
||||
Service message: forum topic created
|
||||
|
||||
|
|
@ -410,6 +416,8 @@ class Message(Object, Update):
|
|||
outgoing: bool = None,
|
||||
matches: List[Match] = None,
|
||||
command: List[str] = None,
|
||||
channel_shared: int = None,
|
||||
user_shared: int = None,
|
||||
forum_topic_created: "types.ForumTopicCreated" = None,
|
||||
forum_topic_closed: "types.ForumTopicClosed" = None,
|
||||
forum_topic_reopened: "types.ForumTopicReopened" = None,
|
||||
|
|
@ -498,6 +506,8 @@ class Message(Object, Update):
|
|||
self.matches = matches
|
||||
self.command = command
|
||||
self.reply_markup = reply_markup
|
||||
self.channel_shared = channel_shared
|
||||
self.user_shared = user_shared
|
||||
self.forum_topic_created = forum_topic_created
|
||||
self.forum_topic_closed = forum_topic_closed
|
||||
self.forum_topic_reopened = forum_topic_reopened
|
||||
|
|
@ -558,6 +568,8 @@ class Message(Object, Update):
|
|||
group_chat_created = None
|
||||
channel_chat_created = None
|
||||
new_chat_photo = None
|
||||
channel_shared = None
|
||||
user_shared = None
|
||||
is_topic_message = None
|
||||
forum_topic_created = None
|
||||
forum_topic_closed = None
|
||||
|
|
@ -606,6 +618,16 @@ class Message(Object, Update):
|
|||
elif isinstance(action, raw.types.MessageActionChatEditPhoto):
|
||||
new_chat_photo = types.Photo._parse(client, action.photo)
|
||||
service_type = enums.MessageServiceType.NEW_CHAT_PHOTO
|
||||
elif isinstance(action, raw.types.MessageActionRequestedPeer):
|
||||
if isinstance(action.peer, raw.types.PeerChannel):
|
||||
channel_shared = int(f"-100{action.peer.channel_id}")
|
||||
service_type = enums.MessageServiceType.ChannelShared
|
||||
elif isinstance(action.peer, raw.types.PeerChat):
|
||||
channel_shared = int(f"-100{action.peer.chat_id}")
|
||||
service_type = enums.MessageServiceType.ChannelShared
|
||||
elif isinstance(action.peer, raw.types.PeerUser):
|
||||
user_shared = action.peer.user_id
|
||||
service_type = enums.MessageServiceType.UserShared
|
||||
elif isinstance(action, raw.types.MessageActionTopicCreate):
|
||||
forum_topic_created = types.ForumTopicCreated._parse(action)
|
||||
service_type = enums.MessageServiceType.FORUM_TOPIC_CREATED
|
||||
|
|
@ -665,6 +687,8 @@ class Message(Object, Update):
|
|||
migrate_from_chat_id=-migrate_from_chat_id if migrate_from_chat_id else None,
|
||||
group_chat_created=group_chat_created,
|
||||
channel_chat_created=channel_chat_created,
|
||||
channel_shared=channel_shared,
|
||||
user_shared=user_shared,
|
||||
is_topic_message=is_topic_message,
|
||||
forum_topic_created=forum_topic_created,
|
||||
forum_topic_closed=forum_topic_closed,
|
||||
|
|
|
|||
Loading…
Reference in a new issue