Message = invalid syntax

coulld someone pls help me with my problem because when i use message it says invalid syntax

**Current behavior: if used message = invalid syntax

**Desired behavior it shoulld run and not give an error

**Repl link: python

import discord
import os

client = discord.Client()

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

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

async message.startswith('&Hello'):
  await ctx.send('Hello, How are you doing?')

async message.startswith('&Good and you?'):
  await ctx.send('Good, Thank you for asking.')

client.run(os.environ('Token code'))
import discord
import os

client = discord.Client()

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

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

  if message.startswith('&Hello'):
   await ctx.send('Hello, How are you doing?')

  if message.startswith('&Good and you?'):
   await ctx.send('Good, Thank you for asking.')

client.run(os.environ('Token code'))

Hello there, @BerkMustafov. I noticed you “solved” your problem, but the code above is the corrected code.

That code will not run IIRC, as it does not include intents

1 Like

I only bothered to solve the issue he was having.

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