Ask coding questions

← Back to all posts
How can I make a Discord quiz
JamesWyatt (0)

I've got the code below but I just wanted to know why the answer is not working. When I run the code on replit and type the command on discord, it doesn't do anything.


if message.content.startswith("Programme Game") or message.content.startswith("programme game") or message.content.startswith("programme Game"):
  game_1 = await"Is 5.09 a Variable or a float?")

  if message.content.startswith("Float") or message.content.startswith("float"):
   await"You Are Correct!!!")
   print("Command executed successfully!")
ryanbrwr (33)

Do you have the whole file for the bot? If this is the only code you're running, you need to start the discord bot with a bot.on('message') or something like that. Here's a link to a tutorial on hosting discord bots on replit, hope it helps!

JamesWyatt (0)

@ryanbrwr Yes, I have a whole file. I'll check out the link but thanks.