I'm trying to validate discord token, sending requests to the discord api, this was working but for some reason it stopped, this is my code:
def validate():
headers = {'Content-Type': 'application/json', 'authorization': "my_token_here"}
request = requests.get("https://discordapp.com/api/v6/users/@me/library", headers=headers)
if(request.status_code == 200):
print("\033[32m[+] Valid Token.\033[m")
else:
print("\033[33m[-] Invalid Token.\033[m")
I put my bot token and still the status is 401, it was working before, can someone help me and explain what happened
Edit:
I noticed that I had placed a slash after library and then I started to receive the unauthorized code 401, even though the token is valid, why does this happen?