By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

JavaScript need help fixing and understanding


New Coder
ive been following a tutorial to make a discord bot for a small server with my friends and am currently struggling to understand why this piece of code is not working.
The aim for this part was to get the bot to say hello when i type hello into the server. The prefix is supposed to be used to initiate the command but when i type it in nothing comes up and im very confused. Thank you
Last edited by a moderator:
You are not properly initializing the Discord client object with the bot token. You have left the token as a comment at the top of the code. That is why it is not working. There are likely errors being printed in the console about this as well. I would advise that you recreate your bot application as you have shared the token in the image you uploaded. That is essentially a bot account password, so you need to make a new one.
Top Bottom