I am trying to code an announce (say) command

Hi there, I am trying to code an announce command. So, the code I need, should provide that only I should be able to announce. Thanks for reading!

Edit 1: the one in this post doesn’t work for me.

Hey there!

Can you tell me what it didn’t work and could you tell me the errors, if any?

I coded something that may work but apparently the command isn’t defined.

Ah, I see. The command variable is only available if you were using a command handler, and also the fact that you were following Discord’s guide on creating a command handler. In your case, you’ll have to use the message variable instead of the command variable.

So try message.content.startsWith(prefix + "say") instead of command === "say" . Make sure to define prefix as the prefix of your bot.

Thanks for the solution. I used another thing instead and it worked, -kinda…

but there is a problem:

me being the owner and still can not use it


solved thanks