gpt4 book ai didi

javascript - 让 Hubot 在 HipChat 中发送直接消息

转载 作者:行者123 更新时间:2023-11-29 18:04:30 26 4
gpt4 key购买 nike

如何告诉 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');
});
};

关于javascript - 让 Hubot 在 HipChat 中发送直接消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32384359/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com