Friday, 28 April 2017

Chatbot dot command not being triggered properly

I am working on a Slack chatbot using botkit and node.js. I'm going to have a lot of commands, so I'm going with dot commands as opposed to webhooks. My code looks like this:

controller.hears(['.help'], 'ambient,direct_message,', function(bot, message)

The idea is a user would type '.help' and then get help. But as it works now, the code is being read as 'anything before the word help and I trigger.' So a user could say "I can't help you with that" and the bot triggers. How do I tell it that I literally want the command to be triggered with a '.help'?

Thanks...still a beginner here and having trouble googling exactly what the issue is with this, so that's why I'm going with a general question.



via AndyG555

No comments:

Post a Comment