SyntaxError: invalid syntax(trying to make a discord bot :/)

So I was watching a tutorial of how to make a custom discord bot but i got this error and it said that :

File "", line 11
    assync def on_message (message):
SyntaxError: invalid syntax

here is also the script:

import discord
import os

client = discord.Client()

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

  assync def on_message(message):
  if message.athor == client.user:

    if message.content.startwith('$hello'):

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

You wrote assync instead of async

p.s. you just gave us your token out so now people can hijack your bot… I would delete that part


Hi @Zxck08 !

Welcome to the forum!

I edited your post so people can’t see your secret token anymore.

Thanks for your help but now it says this
File “”, line 12
if == client.user
IndentationError: expected an indented block
i don’t now anything about coding so i don’t now what i need to do and the tutorial doesn’t show any errors

also next time i won’t show my token

indentation is important in python.

But also, it would probably help if you learned some of the basics first before diving into a tutorial like this.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.