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 796 forks source link

Partial forwarding setting doesn't obey the range #370

Closed tissole closed 1 year ago

tissole commented 1 year ago

Describe the bug If partial forwarding is set like that

offset: 999
end: 1500

The script forwards from 1000 to 1501, so it does not stop at 1500, it forwards one more file (1501).

To Reproduce Set up a partial forwarding from a chat.

Expected behavior The script should stop after forwarding the last message indicated by end:

System information: Ubuntu 22.04 under WSL.

aahnik commented 1 year ago

@tissole this is not a bug. This is how tgcf is designed. I will add this information in the docs, and also in the web UI, so that people can adjust their numbers. (by substracting 1)

so if you want to forward messages starting from msg id = x to message id = y where x and y are included, then you config is like

offset: x-1
end: y-1

Obviously, I can subtract 1 in my code, but due to certain reasons(many reasons, but in simple words, it will break functionality for some other users), have no plans to do it.