Ask coding questions

← Back to all posts
i keep on getting a error
Flare02 (4)

if messege.content.startswith("ayaan is fat"): await messege .content.send("fax")

then it replies with File "main.py", line 19
await messege.channel.send("fax")
^
SyntaxError: 'await' outside function

Comments
hotnewtop
Coder100 (16983)

you forgot to indent remember?

@client.event
async def on_message(messege):
  if messege.author == client.user: 
    return

  if messege.content.startswith('gay'):
    await messege.channel.send('nou')

  if messege.content.startswith("ayaan is fat"):
    await messege.content.send("fax")
Coder100 (16983)

@Flare02

here of course
i fixed the code

Coder100 (16983)

you still didn't indent correctly please read my answer @Flare02

Flare02 (4)

could u make it copy and pasteable im [email protected]

Flare02 (4)

File "main.py", line 18
await messege.channel.send('hi')
^
IndentationError
File "main.py", line 18
if messege.content.startswith("ayaan is fat"): await messege .content.send("fax")@Coder100