Neko Mugs
Neko Mugs

Reputation: 11

I am trying to code a discord music bot and came with this problem

my problem are the packages are the tags one

enter image description here

the main.py code

from discord.ext import commands
import music

cogs = [music]

client = commands.Bot(command_prefix='sus!', intents = discord.Intents.all())

for i in range(len(cogs)):
    cogs[i].setup(client)


client.run("The discord bot id")```


Upvotes: 1

Views: 73

Answers (2)

newbiedpycoder
newbiedpycoder

Reputation: 69

So it seems you forgot to import discord... do
import discord from discord.ext import commands

this is definetly gonna fix your problem but remember you can't take something from something that you haven't imported. Just like you can't take something from discord.ext if you haven't imported discord since discord.ext is extension and you haven't even imported discord.

Upvotes: 1

Arjit Gupta
Arjit Gupta

Reputation: 559

So error seems to be ur syntax error in ur music.py line 2 make from discord.ext import commands

If it works , pls make this answer as accepted answer

Upvotes: 1

Related Questions