Javascript 让Hubot在HipChat中发送直接消息
如何告诉Hubot使用HipChat适配器发送直接消息?我尝试了许多不同的选择,但都没有成功Javascript 让Hubot在HipChat中发送直接消息,javascript,hubot,hipchat,Javascript,Hubot,Hipchat,如何告诉Hubot使用HipChat适配器发送直接消息?我尝试了许多不同的选择,但都没有成功 module.exports = function (robot) { robot.respond(/hi/i, function (msg) { msg.send(msg.message.user.room, 'hi'); // outputs to current room msg.send(msg.message.user.id, 'hi'); // outputs to cu
module.exports = function (robot) {
robot.respond(/hi/i, function (msg) {
msg.send(msg.message.user.room, 'hi'); // outputs to current room
msg.send(msg.message.user.id, 'hi'); // outputs to current room
msg.send(msg.message.user, 'hi'); // outputs to current room
msg.reply('hi'); // @mentions the user in the current room
msg.reply_to('hi') // no reply_to method though I thought I saw this somewhere
});
};
我花了一段时间才找到它,但结果证明它是有效的:
module.exports = function (robot) {
robot.respond(/hi/i, function (msg) {
robot.send({
user: msg.message.user.jid
}, 'hi');
});
};