-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Issue with token verification #2135
Comments
I have tested this with two bots on both the pypi version of this library and the most recent version, but I was unable to reproduce this. It throws an error on login because the authentication failed. EDIT: For reference, this is the traceback that occurs when you try to log in.
|
I'm not too sure, but given that you cannot reproduce this, it may be a Linux specific issue |
On linux, I get a similar, yet slightly different error when having a newline at the end of my token. Traceback:
|
Are you sure you did |
yes |
Interesting |
Maybe it's because I put the key into a different file called with open('secrets.txt', 'r') as KEY: secret = KEY.readlines()
key = secret[0]
bot.run(key) |
Can we please take this issue into the discord.py server? |
Sure |
My discord tag is |
Apperently 2 new lines are needed, according to |
By digging into the code, I have found that this could be a error caused by discord ignoring new lines when authenticating and discord.py not removing the new lines. A fix could be removing all the new lines off the token before authenticating : https://github.com/Rapptz/discord.py/blob/master/discord/client.py#L376 The reason why this error comes up is because when the requests are sent the newlines are included messing up the request. |
The funny part is, you fail to log in with a single new line, but log in fine with two.... But yeah, that is an issue. await self.http.static_login(token.replace("\n", ""), bot=bot) |
Better use |
|
Just ran into this issue -- had |
Summary
Able to log in and do whatever I want, but upon trying to send a message a
411 Length Required
error is thrownReproduction Steps
Just add
\n
to the end of your tokenEDIT Apperently you need 2 newlines, so put
\n\n
at the end of your tokenExpected Results
I expect that the invalid token was caught earlier, preferably before logging in
Actual Results
I could log in to my bot with an invalid key, and only sending a message threw an error
Traceback is here (imgur cuz I don't have the copy-paste)
Checklist
System Information
1.0.1a RW
3.7.3
Kubuntu 18.10 Cosmic Cuttlefish
The text was updated successfully, but these errors were encountered: