How to get a message without a slash? #1085
-
I want to get a message from another, but onText method only gets a message with a command. How do I get a message without a slash? |
Beta Was this translation helpful? Give feedback.
Answered by
danielperez9430
May 18, 2023
Replies: 1 comment
-
You can use also bot on text, but all depends of the regex that you pass to the command.
or // Catch all the messages
bot.on("message", (msg) => {
// Handle the text inside the msg object and you
if(msg?.text && msg.text.includes("hello")) {
// Do something
}
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
danielperez9430
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use also bot on text, but all depends of the regex that you pass to the command.
bot.onText("/hello/")
// Example that catch messages that contains "hello"or