aahnik / tgcf

The ultimate tool to automate custom telegram message forwarding. Live-syncer, Auto-poster, backup-bot, cloner, chat-forwarder, duplicator, ... Call it whatever you like! tgcf can fulfill your custom needs.
https://github.com/aahnik/tgcf/wiki
MIT License
1.34k stars 797 forks source link

Error forwarding 1 message 2 times #309

Closed Xulubu closed 2 years ago

Xulubu commented 2 years ago

Everything is fine except for one error: forward 1 message 2 times. My source is a public channel (join only, no admin rights) The destination is the group that I am an admin for When the source has a message, it will be forwarded twice at the same time I don't know how to fix it, please help, thanks! https://i.imgur.com/E0qVNaB.jpg

tissole commented 2 years ago

Please put a better picture, I can't see much from it. It happened once or is always behaving like this? This can happen in this situation: -you chose not to delete a msg if is deleted in the source -the source sends a msg, then deletes it and sends it again In the source, it will be only 1 msg but in the destination, it will be 2 msgs.

Xulubu commented 2 years ago

I create a private channel and a public group - everything runs great with no errors. When I apply with another private channel (no admin rights), the message is sent 2 times at the same time. I checked the source and waited for more than 10 messages, it still repeats 2 times even though the source message is not deleted. This happens to all channels for which I am not an admin.

https://imgur.com/voVBE1s https://imgur.com/ObS97Yd

tissole commented 2 years ago

Run tgcf live --loud and provide the log when the msgs are send twice.

Xulubu commented 2 years ago

Hi! Yellow is a forwarded message from my channel to my group. The other two messages are from another private channel (not me admin) to my group. It is duplicated. https://i.imgur.com/o2u6KJV.jpeg

tissole commented 2 years ago

Let's clear this stuff a little bit. -1001349387 is a source channel where you're not an admin, right? I can see that at 10.41.57 a message is received there and immediately edited (probably by a bot), then a flood msg occurs. One minute later a new msg is received in that channel or is the same msg? Can you check?

In your destination at 10.41.57 do you have a msg and his copy and another msg and his copy at 10.42.57? Or do you have the same msg at 10.41.57 and at 10.42.57?

Xulubu commented 2 years ago

-Yes, -1001349387 is the source channel (I'm not admin)

10.41.57 is the message in the source channel but in the destination channel 2 same messages are sent at the same time All messages received from the source channel are duplicated twice on the destination channel.

So what should I do to fix this situation, thanks!

tissole commented 2 years ago

If this issue originates in the source there is nothing you can do for now. Maybe in the future, this can be avoided by implementing #213. The first msg will be is sent, the script will wait a little bit, and then will edit the msg in the destination.

You can't prevent this from happening but you can use a script to clear the duplicate msgs in the destination if they are identical.

Xulubu commented 2 years ago

Thank you, hope it will be updated soon in the future!