From d6c980315ec36e0d09ea500545c59a356900040f Mon Sep 17 00:00:00 2001 From: blank X Date: Thu, 11 Feb 2021 19:52:52 +0700 Subject: [PATCH] Add more checks --- rias.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rias.py b/rias.py index ccc3eb7..ba6c29f 100644 --- a/rias.py +++ b/rias.py @@ -131,7 +131,7 @@ async def main(): fwd = await e.forward_to(receive_chat) if not fwd.forward or fwd.forward.sender_id != e.chat_id: user = await e.get_chat() - await fwd.reply(f'Hidden User: {html.escape(get_display_name(user))} ({e.chat_id},{user.access_hash})') + await fwd.reply(f'Hidden User: {html.escape(get_display_name(user))} ({e.chat_id},{user.access_hash})', link_preview=False) @client.on(events.MessageEdited(func=lambda e: e.is_private)) async def no_edits_handler(e): @@ -145,7 +145,7 @@ async def main(): return if reply.forward and reply.forward.sender_id: user = await reply.forward.get_input_sender() - elif (match := hidden_fwd_regex.match(reply.raw_text)) and not reply.forward: + elif (match := hidden_fwd_regex.match(reply.raw_text)) and not reply.forward and not reply.media: user = InputPeerUser(int(match.group(1)), int(match.group(2))) else: return