Problem with discord bot

This is the code:
import discord
import os

client = discord.Client()

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

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

if message.content.startswith(’$hello’):
await (‘Hi!’)‘TOKEN’))
when i run it it says :SyntaxError: ‘await’ outside function

Hey, maybe you can use syntax highlighting and format the code properly using-
print(“this is some code”)
This gets rendered as-

print("this is some code")

Formatting it might help us in helping you figure out the error.
I guess the issue here is that the await (‘Hi!’) isn’t inside the on_message function block. There should be 2 indents there

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