I use Google Calendar Bot (http://slackhq.com/post/124767707715/googlecalendar) from Slack in order to send the message to my bot.
But the botkit did not fire the event.
controller.on('direct_message',function(bot,message) {
// Do something here
});
It only work if the real person send a message
Finally I can use bot_message event
controller.on('bot_message', function(bot, message) {
// Do something here
});
There was a problems that message.text always return null.
@ZuzooVn I was hitting this problem too..in my case, the bot was sending a message that had no text but an attachment field with a fallback in it..maybe yours is doing something like this too?
@gdcohan Me too, we can not get the text because the bot did not send any text. Can you get the text in the attachment in below image?

@gdcohan According to https://api.slack.com/events/message/bot_message, I think we can not get the attachments content.
@gdcohan Finally I can get the attachments content with below code:
javascript
controller.on('bot_message', function(bot, message) {
console.log('message.attachments: ' + message.attachments);
var attachment = message.attachments[0];
console.log('attachments.title: ' + attachment.title);
console.log('attachments.text: ' + attachment.text);
});```
Did bot_message go away? I don't see it anywhere in the code and it's not fired when I receive a message from another bot.
@donavon The above code snippet works for me.
Most helpful comment
@gdcohan Finally I can get the attachments content with below code:
javascript controller.on('bot_message', function(bot, message) { console.log('message.attachments: ' + message.attachments); var attachment = message.attachments[0]; console.log('attachments.title: ' + attachment.title); console.log('attachments.text: ' + attachment.text); });```