http://doatt.com/2015/02/18/the-hubot-msg-object/
http://qiita.com/bouzuya/items/d65a394cac9e76b56d3d
module.exports = (robot) ->
robot.hear /PING$/i, (msg) ->
msg.send "PONG!"
robot.hear /HELLO$/i, (msg) ->
msg.send "hello!"
robot.hear /debug/, (msg) ->
console.log Object(msg)
module.exports = function(robot) {
robot.hear(/hi/i, function(msg) {
msg.send('Hi');
});
robot.hear(/hey/i, function(msg) {
msg.send('HEY');
});
robot.hear(/hoi/i, function(msg) {
msg.send(msg.message.text + msg.name + ' hoi ');
});
robot.hear(/debug/i, function(msg) {
console.log(Object(msg));
});
};
app_1 | message:
app_1 | TextMessage {
app_1 | user:
app_1 | User {
app_1 | id: 'm9sodpzqsf8fpymegu1jhnnhqo',
app_1 | name: 'admin',
app_1 | room: 'town-square' },
app_1 | text: 'subot debugy',
app_1 | id: undefined,
app_1 | done: false,
app_1 | room: 'town-square' },
app_1 | match: [ 'debug', index: 6, input: 'subot debugy' ],
app_1 | envelope:
app_1 | { room: 'town-square',
app_1 | user:
app_1 | User {
app_1 | id: 'm9sodpzqsf8fpymegu1jhnnhqo',
app_1 | name: 'admin',
app_1 | room: 'town-square' },
app_1 | message:
app_1 | TextMessage {
app_1 | user: [Object],
app_1 | text: 'subot debugy',
app_1 | id: undefined,
app_1 | done: false,
app_1 | room: 'town-square' } } }