如何部署在Aws Lambda中使用Botkit构建的slack bot.如果是斜杠命令,我们可以使用下面的代码响应事件.
exports.handler = function(event, context) {
//Echo back the text the user typed in
context.succeed('You sent: ' + event.text);
};
Run Code Online (Sandbox Code Playgroud)
但不知道如何为Bots做同样的事情.使用Botkit(Howdy)的Bots的示例代码是
Controller.hears(['help'], 'direct_message,direct_mention,mention', (bot, message) => {
bot.reply(message, {
text: `You can ask me things like:
"Search Contact"
"Search Account"`
});
});
Run Code Online (Sandbox Code Playgroud)