#dont understand this error
1 messages · Page 1 of 1 (latest)
Can you share the errors?
The right is the console
The left is the code
idk wdym by error
That error is when you have an indent that is inconsistent with the rest of the code block. I would look at the lines of code in that area and line them up properly.
You really don’t give us much to go off, but I see you might be missing a colon in the previous line?
Did everything
This happened
SyntaxError: ‘await’ outside async function
Your setup function needs to be an async function: async def setup(client):
Do I just delete spaces?
Lines 51 and 50 must have the same level of indentation. Delete spaces or tabs, whichever one you are using, such that they line up.
I did line them up same problem
the console error is the same
client.add_cog(music(client))
await ctx.voice_client.connect()```
got a lot of problems but that fixed
well one function call has the ctx as an argument in it and the other one doesn't so you have to make them match
yes see they dont match
you need to pass ctx to match the function definition
so cogs[i].setup(client, ctx)
where ctx is the context
Name ctx is not defined
yes
full
So you just want to initialize not connect to the voice channel?
Okay
client.add_cog(music(client))
```
And then you don’t need a for loop, just call setup(client)
Then I don’t know why you had an await there 🤷
def setup(client):
client.add_cog(music(client))
This problem I delete ctx?
I need await because it gives me this problem
async def setup(client):
await client.add_cog(music(client))
tried to await it like you did but it said it’s out of place tried to space it and delete spaces still
await setup(client)
it always indents even though I matched it and put parths
pls help
hm alright, don't know that one 
- in your Image you have 2 code lines in one line....
it should be:
for i in range( len(cogs) ):
await client.setup( cogs[i] )
Not sure if this is right to setup the cogs, but the syntax is right this way.
most IDEs have an option to format the code, using it may prevent the ident exceptions.
( Shown with an example in the screenshots )
i have no clue what the hell you're doing here.
maybe take a look here:
https://www.w3schools.com/python/default.asp
when you learned the syntax and how to use the language you should try to learn the discord docs