-3

I was trying to make a discord bot in python, I found this instruction on freecodecamp. I just copied their code, like in the video, but every time I run it there is this error message:

Error message

Where is the problem? Please be indulgent I am a novice in programming

RiveN
  • 2,595
  • 11
  • 13
  • 26
foglar
  • 1
  • 5
  • Welcome to StackOverflow. Please include your code (no links), approaches and errors you face. You may also take a look at [how to ask a good question](https://stackoverflow.com/help/how-to-ask). – Dominik Oct 07 '21 at 18:37

2 Answers2

-1

It's happening because you probably forgot to paste your Discord BOT Token into secrets (repl.it substitute for .env file).

  1. Go to your repl on repl.it.
  2. Go to secrets (padlock icon on your left).
  3. Use TOKEN as your key and paste your token inside value.
  4. Click save and it should work!

Remember to import os!

Screenshots

Where are secrets?

secrets location screenshot

Example secret with Discord BOT token:

Example secret

RiveN
  • 2,595
  • 11
  • 13
  • 26
-2

make an env and then put TOKEN then enter the bots token