0

So on python (Discord.py mainly) i keep getting the same error on a "$move" command how do i fix it.

the error is

python -u "/Users/ats/Desktop/bot.py"
iMac:~ ats$ python -u "/Users/ats/Desktop/bot.py
  File "/Users/ats/Desktop/bot.py", line 8
    async def on_ready():
        ^

SyntaxError: invalid syntax

Please help me.

Here is my code: (Click this blue text)

------------------------------------------ NOTE: i have no experience in coding

Wasi Master
  • 1,112
  • 2
  • 11
  • 22
  • 1
    Have you tried importing `asyncio`? Also, don't attach images, post code into your question directly surrounded by triple backticks. – NotAName Sep 14 '21 at 00:26
  • what is the output when you do `python --version` on the same terminal? – shark Sep 14 '21 at 02:08
  • in the bottom left corner, it says python 3.9.7. which should work. but I believe MacOS comes with python 2.7 installed by default, please check if that's the case using `python --version` – Wasi Master Sep 14 '21 at 05:11
  • 1
    "I have no experience in coding"... Before asking a question you need to understand the language you are coding in. [Here's how to ask a good question](https://stackoverflow.com/help/how-to-ask) – ChaoticNebula Sep 14 '21 at 09:57
  • Like `@WasiMaster` said, try the command `python3` instead of `python` to see if the issue is regarding that. – Suda Sep 14 '21 at 14:20
  • Also seems like you forgot the commas in the `embed` variable. `embed = discord.Embed(title="ERROR", description=e, colour=discord.Color.red()` – FileX Sep 14 '21 at 20:08

1 Answers1

0

u change your on_ready with this

@client.event
async def on_ready():
    print(f"we have logged in as {client.user}")
Dj Walkzz
  • 492
  • 3
  • 10