Bot that listens to code words
How do I make a bot that listens to a "secret code word" and performs an action when someone says it? This cannot be a slash command because slash commands show up when you type in "/".
4 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OP:event: (event) Client#messageCreate
@14.16.3
Emitted whenever a message is created.
:property: Message#content @14.16.3
The content of the message. This property requires the GatewayIntentBits.MessageContent privileged intent in a guild for messages that do not mention the client.On the "messagecreate" event, check if the message.content == your code word.
You can make it like this