Discord Bot problems
Ok so i have started using discord and made this bot a while ago, and it worked fine but now when i try to run it it gives me an error with the first line being about client.run()
im very confused.
These are the errors ive been getting. Please run the bot yourself to see the full list.
I have a chat filter built in so if you are not comfortable with seeing explicit words please dont look.
Alright, for future people, https://docs.repl.it/repls/secret-keys
basically, create a .env
file (exactly that, cannot be token.env
, anything.env
only .env
):
KEY=VALUE # No spaces
Delete the token.env and create a new file just named .env with the token in it like you did before.
If its not .env I don't know if os.getenv will pick it up, but also repl will show your token to everyone if its not just .env.
Also try deleting the package discord (mirror) and downloading the package discord.py instead. If it doesn't install press ctrl+shift+s to open a shell and install it using pip. pip install discord.py
ok, for ur bad words thing, i suggest using tolower() for it so u dont have to write it many times. I mean, how will u catch it if a words was LiKe ThIs...
Anyways, the thing is, we will never be able to see your error because repl.it will not show the .env file for us, thus breaking the bot (no .env file, no token)
alright then
@NarwhalFanaticfrom what I can see, that's the only error
@NarwhalFanaticPost On Stack Overflow
ooof... i acidentally scrolled down
wrong token!
can you like copy and paste the entire contents
@NarwhalFanaticOHHH I GOT IT NOW!!
@NarwhalFanatic
.env
is not python!! It is CASE SENSITIVE and cannot have quotation marks because it is a shell file.correct
incorrect
I think my answer seems to work check it out below or above idk. But I think it has to do with the mirror package of discord.py. Delete or remove the discord package from your packages on the side and install discord.py. Install it using pip if it doesn't install from the sidebar thing (
@NarwhalFanaticpip install discord.py
). Also import discord.py likeimport discord