How do I fix this error when coding my new bot?

Viewed 30
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    bot = commands.Bot(command_prefix=".", intents=intents)
NameError: name 'commands' is not defined
 

I follow the code on the youtube but an error occurred and idk how to fix this? enter image description here

I am need to code a bot and I'm learning Python basic

3 Answers

The tutorial is outdated. It's for discord.js v12 I think. They are using v14 now. V12 is no longer supported.

You have already imported everything from the commands module, so just say bot = Bot(..)

Ah, sorry, i thought you were using discord.js but turns out you use python, lol. Just try using a newer tutorial: https://youtu.be/hoDLj0IzZMU

Related