diff --git a/pyrogram/types/messages_and_media/message_entity.py b/pyrogram/types/messages_and_media/message_entity.py index ac14b621..d2bf654d 100644 --- a/pyrogram/types/messages_and_media/message_entity.py +++ b/pyrogram/types/messages_and_media/message_entity.py @@ -112,8 +112,9 @@ class MessageEntity(Object): if self.language is None: args.pop("language") - if self.custom_emoji_id is None: - args.pop("custom_emoji_id") + args.pop("custom_emoji_id") + if self.custom_emoji_id is not None: + args["document_id"] = self.custom_emoji_id entity = self.type.value