Ask coding questions

← Back to all posts
Does anyone know what i need to do to fix this?
drurythom2304 (1)

I need a bit of help wth some coding thx

catspython (28)

look at line 20, then change

if message.content.startswith("Hp"):await"Hg   Hr   Hh   Hs")


if message.content.startswith("Hp"):
  await"Hg   Hr   Hh   Hs")
drurythom2304 (1)

that makes the whole thing an error

catspython (28)

@drurythom2304 give me a screen shot of the error

catspython (28)

@drurythom2304 The error is because you didn't make the change to put await down a line.

Coder100 (18148)

Ya put the if statements the wrong place

Put them inside the on_message function.

drurythom2304 (1)

@Coder100 dude im new to dis stuff do u know what i do?

robowolf (549)

Line 42 has a space. Put it at the very edge or indent it properly into line 39's if statement to fix it.

ch1ck3n (2055)
import discord
import os

client = discord.Client() 

async def on_ready():
  print("We have logged in a {0.user}            ".format(client))

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


if message.content.startswith("Hp"):
   await"Hg   Hr   Hh   Hs")

if message.content.startswith("Hg"):
   await"You Have chosen Gryfindor")

if message.content.startswith("Hgme"):
   await"Me, Gryfindor, Lion guard, Professor Mcgonagal's Prize Pupil")

if message.content.startswith("Hr"):
   await"You have chosen Ravenclaw")
if message.content.startswith("Hrme"):
    await"Me, Ravenclaw, Predator Bird, Professor Flitwick's Prize Pupil")
if message.content.startswith("Hh"):
    await"You have chosen Hufflepuff")
if message.content.startswith("Hhme"):
  await"Me, Hufflepuff, Honey Hunter, Professor Sprouts Plantologist")
if message.content.startswith("Hs"):
    await"You have chosen Slytherin")
if message.content.startswith("Hsme"): 
    await"Me, Slytherin, Cold Blood Killer Professor Snapes Top Student")
PYTHORE3605 (140)

Your indents don't match up. go into setting in the repl and change it and then you have to go back and re indent everything (ik it sucks but it is something you have to do sometimes)