How to send message in function catchALL? #1597
-
hi all module.exports = (robot) => {
robot.catchAll((msg) => {
let message = msg.message
robot.send('hello')
msg.finish()
})
} but it is not working, any solution? |
Beta Was this translation helpful? Give feedback.
Answered by
Nothingtoloose
Nov 8, 2017
Replies: 1 comment
-
Here is a simple example. The example has the goal that Hubot always responds when he does not recognize a command. module.exports = (robot) ->
robot.catchAll (msg) ->
match = /^\@Hubot+/i.test(msg.message.text) or /^\Hubot+/i.test(msg.message.text)
if match
msg.send "Der Befehl '#{msg.message.text}' wurde nicht erkannt. \nBitte geben Sie '@hubot Hilfe' ein, um sich alle Befehle angezeigen zu lassen." |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
technicalpickles
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is a simple example. The example has the goal that Hubot always responds when he does not recognize a command.