Having trouble with '@client.event' in discord bot

here’s the code I wrote:

import discord
import os


async def on_ready():
print(‘we have logged in as {0.user}’.format(client))

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

if message.content.startswith('hello'):
	await message.channel.send('hi!')


however whenever I run it it gives me an error:

'Traceback (most recent call last):
file “main.py”, line 7 in
async def on_ready():
TypeError: event() missing 1 required positional argument: ‘coro’ ’

It looks like this code is missing indents that discord.on_ready() and discord.on_message() need in order to know when to be called.

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