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

Please Make a burst mode optional. #92

Closed ghost closed 3 years ago

ghost commented 3 years ago

Is your feature request related to a problem? Please describe.

Sometimes Telegram Account Limited Error occurs. As you know, telegram Account Limited Error is an error which happens when an account sends many messages at once. This does not cause any permanent issues with the account. But When this error happens tgcf will not send any more messages via the account. (Temporary wait limit)

Describe the solution you'd like

It would be very helpful if you provided message rate options.

example : [burst mode - High or Low]

It will be able to reduce the frequency of occurrence of the telegram Account Limited Error.

Describe alternatives you've considered

Alternatively, it would be fine to be able to set the interval between sending messages in seconds.

example: sent every [10] seconds

Thank you! This project is evolving every day.

aahnik commented 3 years ago

read this https://github.com/aahnik/tgcf/wiki/Flood-wait-errors-and-bans and https://github.com/aahnik/tgcf/discussions/90#discussioncomment-653468

let flood wait errors occur. when they occur tgcf waits and then resumes.

why create an artificial delay when not required ?

you are saying to send every 10 seconds, that will take more time to complete the entire thing. i am not interested in going that way.

when the rate limit is reached, then wait, and then continue. that's the philosophy of tgcf

ghost commented 3 years ago

Thank you. You are right.

aahnik commented 3 years ago

Hi @comienzo2093 , are you replying from email?

why so much Chinese text here?

image

please use English as the medium of communication 🙏

tissole commented 3 years ago

I want to comment on this issue. I think a big concern that is on everyone’s mind is that TG will consider the number of messages forwarded as spam and start banning accounts. So without triggering the flood warning the risk will disappear.

I agree that the script must be fast. But maybe applying some limits will make it even faster. I know is a bit counterintuitive but hear me out.

Currently, the script takes about 10 minutes to forward ~2000 messages and then stops and waits approx. 50 minutes (limit imposed by TG). So in 1 hour can forward 2000 messages. In a day the script can forward ~2000x24=~48.000 messages. For that, it works 10 minutes every hour so in 24 hours works 240 minutes ~4 hours. So the vast majority of time is spent waiting.

According to this source TG allows 1 message per second. Currently, the script's speed is ~3.3 messages per second. If the rate is lowered to 1msg/s it will forward 3600 msg/s and ~86.000 msg/day, more than currently does, because even if will forwarding slower it will not waits.

Maybe give it a try, make a test build so we can play with it and see the results.

ghost commented 3 years ago

Hi @comienzo2093 , are you replying from email?

why so much Chinese text here?

please use English as the medium of communication 🙏

Oh, I used Google Translate and it was written in Korean by mistake. Ok, I will use English!

aahnik commented 3 years ago

hi @tissole , thank you for your ideas. I will definitely think about this.

ghost commented 3 years ago

I agree with your opinion. (when they occur tgcf waits and then resumes)

I forwarded over 20000 messages with tgcf today, and it was okay! I will continue testing in the future and report the results once I get enough data.

Also, I created a bot, and then tested bulk message forwarding with bot account. I thought bot login is a good alternative, Because with the bot I don't even have to worry about whether or not this account limit exists.

By the way, there were some problems. when the chat was posted to the source at a high rate, the bot didn't seem to be able to handle this. After forwarding about 20 chats per minute, It stopped. Of course Stopping didn't matter. Because it will resume if I wait. But the problem is that some messages were not forwarded. (Skipped)

I discovered this a while ago. After testing several times under controlled conditions, I will post again about this. In addition, your project is literally amazing. Thank you.

aahnik commented 3 years ago

hi @comienzo2093, the rate limit of bot is lower.

Telegram allows less no of messages to be sent by the bot account per minute

so I don't think this can be solved.

ghost commented 3 years ago

hi @comienzo2093, the rate limit of bot is lower.

Telegram allows less no of messages to be sent by the bot account per minute

so I don't think this can be solved.

Yes, thank you for your answer. I understood your answer.

And I am testing tgcf with 5 accounts, only 1 account is blocked. I was continuing to chat manually without noticing that my telegram account was in the'Temporary wait limit' state, and my account was suddenly blocked.

This was my mistake. I should be careful when chatting while using tgcf. Other than that, I tested with more than 140,000 forwardings, but there was no account block.

tissole commented 3 years ago

@comienzo2093, hmm interesting! Could you give more detail about the account blocked? Was it a new account or an old one? Did you use a normal SIM number phone or virtual number? If it possible can you say from what country? How many messages did you forward before it was blocked? It is a temporary ban or the account is gone forever? Did you talk with Telegram support?

@aahnik This site shows the different limits on Telegram. It says Message forwarding up to 2,000 per hour This is what I observed when using the script. So maybe the limit is per hour, in this case limiting the rate to match this limit will resolve the flood alerts (1.8 msg/h). Or limiting the script to only forward 2000 msg and then to stop till 1 hour passes so as to not trigger the flood alerts.

ghost commented 3 years ago

@tissole

Was it a new account or an old one?

Did you use a normal SIM number phone or virtual number?

If it possible can you say from what country?

How many messages did you forward before it was blocked?

It is a temporary ban or the account is gone forever?

Did you talk with Telegram support?

tissole commented 3 years ago

Thank you for the detailed answer. It is very helpful to know what triggers these bans. Another user account was banned in the same conditions: new account and a big number of forwards in a short time.

Another element that seems to trigger the bans is the type of phone number. From Telegram: "Some numbers may trigger an overly harsh response from our system, either due to their previous owners‘ activities or due to them being certain virtual/VOIP numbers. We’re sorry if this resulted in your account being limited for no reason. If you think this is your case, please contact @SpamBot and tell it your story."

Till now, 3 factors seem to play a role in the bans:

So a prudent approach is to use an old account, a SIM number, and to progressively increase the number of forwards over time. The definitive solution is to prevent altogether these flood messages to occur because these trigger the automation system put in place by TG. Now the limit seems to be 2000 msg/hour, so obeying this limit probably will secure the account in the future.

I want to ask you one more thing. Please write to TG @SpamBot and be honest, tell them that you use a script to forward some messages to your channel. At least we will know the TG policy about these scripts and if they lift the ban (I heard that the ban is temporary 24-72 hours). Probably the TG systems confuse the big number of flood msg from an account with a spamming activity.

aahnik commented 3 years ago

hi @tissole this https://github.com/aahnik/tgcf/issues/92#issuecomment-826677829 logic is not correct.

if i get time, I will explain in detail later.

and stop worrying about rate limits. all apis impose rate limit. that is enforced from the backend server. all these workarounds are useless.