mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-27 16:45:19 +00:00
Fixed "ChannelPrivate" exception on parse param "reply_to_message" (#9)
This commit is contained in:
parent
997f1dbe7b
commit
2190ae4a49
@ -25,7 +25,7 @@ import pyrogram
|
||||
from pyrogram import raw, enums
|
||||
from pyrogram import types
|
||||
from pyrogram import utils
|
||||
from pyrogram.errors import MessageIdsEmpty, PeerIdInvalid
|
||||
from pyrogram.errors import MessageIdsEmpty, PeerIdInvalid, ChannelPrivate
|
||||
from pyrogram.parser import utils as parser_utils, Parser
|
||||
from ..object import Object
|
||||
from ..update import Update
|
||||
@ -1028,10 +1028,13 @@ class Message(Object, Update):
|
||||
reply_to_message = client.message_cache[key]
|
||||
|
||||
if not reply_to_message:
|
||||
try:
|
||||
reply_to_message = await client.get_messages(
|
||||
replies=replies - 1,
|
||||
**reply_to_params
|
||||
)
|
||||
except ChannelPrivate:
|
||||
pass
|
||||
if reply_to_message and not reply_to_message.forum_topic_created:
|
||||
parsed_message.reply_to_message = reply_to_message
|
||||
except MessageIdsEmpty:
|
||||
|
Loading…
Reference in New Issue
Block a user