Add more checks

This commit is contained in:
blank X 2021-02-11 19:52:52 +07:00
parent 4ac0d187d1
commit d6c980315e
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 2 additions and 2 deletions

View File

@ -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: <a href="tg://user?id={e.chat_id}">{html.escape(get_display_name(user))}</a> (<code>{e.chat_id}</code>,<code>{user.access_hash}</code>)')
await fwd.reply(f'Hidden User: <a href="tg://user?id={e.chat_id}">{html.escape(get_display_name(user))}</a> (<code>{e.chat_id}</code>,<code>{user.access_hash}</code>)', 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