I have a discord bot that does nothing (just the “set up” code), made with discord.py.
When I pass the token directly as a variable, it runs normally.
But I don’t want the token to be exposed, so I copy it into “secrets”.
When I run it again, it says the “token is improper”, while the same token works when passed directly.
I have tried to reset the token, repl, browser etc. I’ve tried making a new repl and using a new bot, but it still doesn’t work.
I have other bots/repls that work normally with their token in “secrets” (that were made before this bug appeared).
Here is the repl where the problem appears:
raise HTTPException(response, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
raise LoginFailure(‘Improper token has been passed.’) from exc
discord.errors.LoginFailure: Improper token has been passed.