I used the token grabbed from dev tools > network > message > authentication
yet program returns with error
Code
Traceback (most recent call last):
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 254, in request
raise HTTPException(r, 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\Desktop\Self User.py", line 113, in
bot.run("{im not giving u my token}")
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 723, in run
return future.result()
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 702, in runner
await self.start(*args, **kwargs)
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 665, in start
await self.login(*args, bot=bot)
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 304, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
heres the source code:
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix="/")
@bot.event
async def on_ready():
print("-"*20)
print("Logged In As")
print(f"User: {bot.user.name}")
print(f"ID: {bot.user.id}")
print("-"*20)
@bot.command()
async def ping(ctx):
await ctx.send("pong")
bot.run("MY TOKEN BUT HIDDEN")
Expected Results
the bot was supposed to connect to discord and respond to every message that is named /ping but instead it returns with Improper token
Actual Results
program returns with following error:
Traceback (most recent call last):
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 300, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 254, in request
raise HTTPException(r, 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\Desktop\Self User.py", line 113, in
bot.run("{im not giving u my token}")
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 723, in run
return future.result()
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 702, in runner
await self.start(*args, *kwargs)
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 665, in start
await self.login(args, bot=bot)
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 511, in login
await self.http.static_login(token.strip(), bot=bot)
File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 304, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
System Information
Python v3.7.7-final
discord.py v1.7.3-final
aiohttp v3.7.4.post0
system info: Windows 10 10.0.19041
Checklist
[X] I have searched the open issues for duplicates.
[X] I have shared the entire traceback.
[X] I am using a user token (and it isn't visible in the code).
Summary
improper token
Reproduction Steps
I used the token grabbed from dev tools > network > message > authentication yet program returns with error
Code
Expected Results
the bot was supposed to connect to discord and respond to every message that is named /ping but instead it returns with Improper token
Actual Results
program returns with following error:
Traceback (most recent call last): File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 300, in static_login data = await self.request(Route('GET', '/users/@me')) File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 254, in request raise HTTPException(r, 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\Desktop\Self User.py", line 113, in bot.run("{im not giving u my token}") File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 723, in run return future.result() File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 702, in runner await self.start(*args, *kwargs) File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 665, in start await self.login(args, bot=bot) File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 511, in login await self.http.static_login(token.strip(), bot=bot) File "C:\Users\AppData\Roaming\Python\Python37\site-packages\discord\http.py", line 304, 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