I want to make a code which allow the user to write a command like this "!speedwagon message". Whenever the user do this, the message will replace the value of a variable called personality. Could you help me with this? I do not really know how to set up commands or variables in discord js so any help would be quite useful.
#I want to make a code which allow the user to write a command like this !speedwagon message.
5 messages · Page 1 of 1 (latest)
• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.
I want to make a code which allow the user to write a command like this !speedwagon message.
Hi, you should use the messageCreate event to do the command. First of all you have to set a prefix that in your case is ! and then do: if (message.startsWith(prefix + "speedwagon")) {}. (There is other ways). Then you do the rest of the Code.
But since you seem to get started writing bots just yet it might be easier for you to make a slashcommand instead.