Making the bot say something but failing please help

So like I was trying to make a discord bot using and i made the bot online but when I try to use this command:
if message.content.startswith(’$hello’):
It just doesn’t work.

hey inclarition,

welcome to the FCC community, we are happy to have you here!

Could you link the code challenge that you worked on and perhaps also your replit project? It helps us to understand the context in which you built your application.

It would also be nice if you use the syntax highlighting support of the forum.
Here is a nice tutorial that shows you how you can highlight your code:


Hello gdennci, thank you for coming to help me and for telling me how to give my codes. And for the project I’ve been working on, here is the link.

if message.content.startswith('$inspire'):

You need and indent before the await. If that’s not the problem can you copy your code and send it with 3 ` at the start before you send

Get rid of the line:

cmd_prefix "|"

It is completely unnecessary for the code you have written so far

I removed the prefix and

import discord

client = discord.Client()

async def on_ready():
 print('We are now ready to use {0.user}'.format(client))

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

     if message.content.startswith('|hello'):

Have you placed your ‘TOKEN’ in the secrets bar at the side?

yes as I said i can make the bot come online but sadly it doesn’t say anything when I type “|hello”

add me to the code please using the +invite

I’m Dxvil6354

Sure give me a second

There is no one called Dxvil6354 but there is only one Dxvil is that you?

i have the same problem and I also don’t know how to add a .env file from the sidebar ?

Yes i can help you with .env So when you click on the secret thing on the siidebar like the thing that has the emoji of a lock. When you click on that, you will see two things ine is a “key” and the other one is “value”. So what you want to do is write “TOKEN” in the “key” section. Note: By “TOKEN” I do NOT mean the bot token i just mean you have to write the word TOKEN. And then in the value section, now you have to write the BOT TOKEN here. I am sorry if my explanation is bad but I hope ylu will understand.

Yes. Most Likely is me!

helppp me too icant fix this :frowning: the

await ting :frowning:

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