Error that i dont know how to fix

Well I have an Problem With the Sentence: await message.channel.send(‘Hello!’) It keeps Telling Me That Await is an Outside function
What do i do In this Case

https://i.gyazo.com/37edcf0b63f999e709ae0f5f28926155.png

I’m not a Python guy, and I can’t see your whole code, but…

The way that I read that error, it is not telling that await “is an outside function”, but it is complaining that awaitis outside a function”. Assuming Python is like JS, it must be inside a function, presumably an async function.

Hey Gabriel, can you link or send the contents of main.py esp. near line 1-23?
I think you missed an indent, and this statement is outside an asynchronous function definition. The indentation should be somewhat like this-

async def on_message(message):
    if message.content.startswith("hi"):
        await message.channel.send("hello!")

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