-
Notifications
You must be signed in to change notification settings - Fork 3
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
Handle bad token #71
Comments
assuming that EC_TOKEN will be the permanent method of handling the bot token |
@ianagbip1oti, some guidance please, so I made an attempt at the null check, but after I finished and started digging deeper it seems intrinsically built in already as part of the BotToken object, so not so sure at what 'level' this kind of exception check should be handled in It appears that this already throws a semi suitable exception, just change the message to suit? Format validity? |
I don't think we need to check the token format. If a token is provided we attempt to login with it, and handle the error message Discord sends us back. Otherwise yeah, we just want more user friendly error messages in the exception. There is no significance to the 5381 in |
Handled bad token by catching authentication issues given by discord. Starts to go bad once you hit the rate limit but that should be worried about by the client. I do null checks for the EC_TOKEN however if the token is for example |
What rate limit are you referring to here? |
If you try to connect too many times within a certain period time with |
Is the app doing these identifys, or is the app being run multiple times by the user to hit this rate limit? |
Being run multiple times by the user, hence why it's not really our problem. The identifies are only being run once per app however if the user kind of spams the app it will start not throwing auth errors and instead broken pipe errors. Nothing we have to deal with but I thought it was worth mentioning if you want to watch for that staff on app startup. |
As long as we're accurately reporting to them that they're having issues because their token is wrong, then there's not much we can do. |
That's the issue, once they hit the rate limit we can't accurately tell them what's going wrong. |
Do you mean opcode 9 invalid session? opcode 10 is the hello message. I'm ok with that to start with, we would have given them a bad token message many times before they hit the rate limit. We can handle cases of invalid session followed by a failure to resume later. |
No, I don't mean opcode 9, it gives us an opcode 10 hello message and spams it. I've done pretty extensive testing with it. Trying to give me an invalid session, but it always just spams 10 or closes with an auth error. |
Handle cleanly case when the bot token is bad.
Perhaps by throwing an ErisCasperFatalException?
The text was updated successfully, but these errors were encountered: