-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Idea: add fool protection in "start" function to avoid accidental ban for flood #664
Comments
Have you tried adding a delay in your own code on every retry? If you have a while() loop which has error-handling - it's a good idea to add a delay between retries. So at the end of your while loop, right after the last "catch" clause - just add something like this: But overall - if you try to bombard any service with repeated login attempts - you will get limited by that service. I don't think it's anyhow an issue for GramJS devs to deal with. Because Gram.js, like nearly any framework, does exactly what you ask it to do. You'd get the same results with Discord or even normal bot frameworks like Telegraf.js - if you wrote your loop in such a way as to keep constantly trying to login. |
@MJBlack9000, I forgot to mention that this problem occurs in |
Steps to reproduce:
phoneCode
callback to always return the same resolved promise.true
fromonError
callback.auth.SignIn
throwsPhoneCodeExpiredError
.In a couple of seconds this combination got my account banned for flood for 1 hour, due to hundreds of signIn attempts before I stopped the server manually.
Relevant
while
loop:gramjs/gramjs/client/auth.ts
Lines 168 to 210 in 0471403
The text was updated successfully, but these errors were encountered: