Ask coding questions

← Back to all posts
my problem
Manin1 (0)

sir my 'return'word is with underline so it is not running

Comments
hotnewtop
Coder100 (18092)

don't forget to have correct indentation, here is the corrected code:

import discord

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.content.startswith('!hi'):
        await message.channel.send('hello')


client.run('ODQ1NTk0ODg0OTAzNDAzNTUw.YKjPmg.dyECVZEwz6bMLHDeyDx01l_722c')
IMayBeMe (458)

You just forgot to indent it correctly, just hit the space bar and alight it with the if statements to fix your issue