Ask coding questions

← Back to all posts
What is wrong with line 11
MahalaHala (0)

I really don't know what's wrong with line 11 please help

Answered by btfuss (177) [earned 5 cycles]
View Answer
btfuss (177)

First of all, the function doesn't return anything. Second of all your if statement on line 14 has only 1 space, add another.

MahalaHala (0)

I keep trying to solve it and another line has a problem, the problem line 15

btfuss (177)

Here is the fixed code:

import os 

client = discord.Client()

async def on_ready():
 print ('We have logged in as {0.user}'
  .format ( client ))

async def  on_message (message): 
   if client.user:

   if message.content.startswith("!h")
       await ('Whatcha want')
my_secret = os.environ['!h']```

## To indent, use tab
MahalaHala (0)

it says line 17 is invalid


btfuss (177)

@MahalaHala Yeah I saw that it didn't work.
Tell me when you copied the code!

Also, I just saw the error. You haven't created an environment variable. You have to set them using this article:

btfuss (177)

@MahalaHala If this worked, do you mind selecting yours truly and the answer?

im cycle hungry lol