Closed floorshame closed 2 years ago
issue fixed its self? not sure why maybe look into it though
To fix this issue follow these steps lmao: git clone https://github.com/dolfies/discord.py-self cd discord.py-self pip install -U .[voice] pip uninstall discord.py-self pip install discord.py-self
You're importing selfcord
(which gets you discord.py-self), but you're importing the commands ext from discord
, which I'm assuming is the original, bot-only discord.py.
Either import the ext from selfcord
, or uninstall discord.py and install discord.py-self.
I am also randomly getting discord.errors.LoginFailure: Improper token has been passed
for a running bot.
So I add token and randomly it get's invalidated without me calling logout.
I have to generate the fresh token to make it work again.
Summary
discord.errors.LoginFailure: Improper token has been passed.
Reproduction Steps
Code
Expected Results
For it to login into my acount, then when i run ping it will reply with pong
Actual Results
Traceback (most recent call last): File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 406, in static_login data = await self.request(Route("GET", "/users/@me")) File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 359, in request raise HTTPException(response, data) discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "c:\Users\me\OneDrive\Desktop\rainbot.py", line 10, in
bot.run('mytoken')
File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 715, in run
return future.result()
File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 694, in runner
await self.start(*args, **kwargs)
File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 657, in start
await self.login(token)
File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 514, in login
data = await self.http.static_login(token.strip())
File "C:\Users\me\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 410, in static_login
raise LoginFailure("Improper token has been passed.") from exc
discord.errors.LoginFailure: Improper token has been passed.
System Information
Checklist
Additional Information
No response