Ask coding questions

← Back to all posts
i need some help for a discord bot DM me at discord ADMAAV#6469
ADMAAV (2)

i cant seem to fix one thing on it can someone help at all as soon as possable will be really nice :P i am new to coding if you dindt know

Comments
hotnewtop
Coder100 (16855)


you need to indent here

correct code

import discord 
import os

client = discord.Client()

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

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

    if message.content.startswith('!hello'):
        await message.channel.send('Hello how are you?')

client.run(os.getenv('TOKEN'))
ADMAAV (2)

@Coder100 thanks really helpful

Coder100 (16855)

mar as correct answer please @ADMAAV