[英]Make Hubot send a direct message in 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 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');
});
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.