mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Don't return None
This will break Message Pin handling
This commit is contained in:
parent
4adc55a070
commit
a2590f3bc8
@ -730,9 +730,6 @@ class Client:
|
|||||||
elif isinstance(message, types.MessageService):
|
elif isinstance(message, types.MessageService):
|
||||||
m = utils.parse_message_service(message, users, chats)
|
m = utils.parse_message_service(message, users, chats)
|
||||||
|
|
||||||
if m is None:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if isinstance(message.action, types.MessageActionPinMessage):
|
if isinstance(message.action, types.MessageActionPinMessage):
|
||||||
pm = self.get_messages(m.chat.id, [message.reply_to_msg_id])
|
pm = self.get_messages(m.chat.id, [message.reply_to_msg_id])
|
||||||
|
|
||||||
|
@ -368,7 +368,7 @@ def parse_message(message: types.Message, users: dict, chats: dict) -> pyrogram.
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def parse_message_service(message: types.MessageService, users: dict, chats: dict) -> pyrogram.Message or None:
|
def parse_message_service(message: types.MessageService, users: dict, chats: dict) -> pyrogram.Message:
|
||||||
action = message.action
|
action = message.action
|
||||||
|
|
||||||
new_chat_members = None
|
new_chat_members = None
|
||||||
@ -395,8 +395,6 @@ def parse_message_service(message: types.MessageService, users: dict, chats: dic
|
|||||||
migrate_from_chat_id = action.chat_id
|
migrate_from_chat_id = action.chat_id
|
||||||
elif isinstance(action, types.MessageActionChatCreate):
|
elif isinstance(action, types.MessageActionChatCreate):
|
||||||
group_chat_created = True
|
group_chat_created = True
|
||||||
else:
|
|
||||||
return None
|
|
||||||
|
|
||||||
return pyrogram.Message(
|
return pyrogram.Message(
|
||||||
message_id=message.id,
|
message_id=message.id,
|
||||||
@ -413,7 +411,6 @@ def parse_message_service(message: types.MessageService, users: dict, chats: dic
|
|||||||
group_chat_created=group_chat_created
|
group_chat_created=group_chat_created
|
||||||
# TODO: supergroup_chat_created
|
# TODO: supergroup_chat_created
|
||||||
# TODO: channel_chat_created
|
# TODO: channel_chat_created
|
||||||
# TODO: pinned_message
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user