Python Forum
Sent message by Telethon marked as read
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sent message by Telethon marked as read
#1
Hi, with the following code i parse same telegram channels and just for messages that is interesting for me i forward them to my own other specific channel; monitored channels then has all marked as read whenever i new message is coming.

client = TelegramClient(StringSession(session_token), api_id, api_hash)
client.start()

destination_group_invite_link='https://t.me/joinchat/XHFDSFDGFS'
destination=client.get_entity(destination_group_invite_link)


@client.on(events.NewMessage(chats=myChannelIDList))
async def my_event_handler(event):
    rx = event.text.split()
    for parola in rx:
        if parola.lower() in paroleChiave:
           
            await client.send_message(entity=destination, message=event.message, silent=False)
            break
    await client.send_read_acknowledge(event.chat_id)

client.run_until_disconnected()
Issue is that using telethon send_message, message is marked as read in destination channel as well. It should not because it is not part of "myChannelIDList".
If I use request as python library to send message, it work well and message is not marked as read until i click on channel (telegram app) and read it.

Telethon client signed in as my telegram account. What I do is forwarding messages to my own channel. Is this a possible issue?

P.S. I am not using request to send message because I can only send text and not images that is present in forwarded messages.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  telegram + telethon download message and foto and republish faustf 0 1,808 Oct-12-2021, 05:09 PM
Last Post: faustf
  How to install Telethon? Sharon 9 15,324 Apr-21-2019, 08:32 AM
Last Post: Sharon

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020