标签: hubot

Hubot的github-pull-request-notifier.coffee

我最近得到了irc的hubot设置并且工作正常.我正在尝试添加此脚本.

但是,我并不完全理解设置说明.阅读设置说明

curl -H "Authorization: token <your api token>" \
-d '{"name":"web","active":true,"events":["pull_request"],"config":{"url":"<this script url>","content_type":"json"}}' \
https://api.github.com/repos/<your user>/<your repo>/hooks
Run Code Online (Sandbox Code Playgroud)

我不明白所指的"url":"<this script url>"是什么.谁知道?

如果有帮助我正在部署到heroku.

hubot

6
推荐指数
2
解决办法
936
查看次数

在HipChat上的Hubot中匹配用户名和@mention名称

有没有办法找到用户名的@mention名称(数字xxxx_xxxxxx或全名),反之亦然?

查看msg.message对象,有一个用户对象,其中包含消息来自的人员的id,jid和名称.我想找到那个人的@mention名字,也可能是他们在邮件中提到的任何人的用户名.

hubot

5
推荐指数
1
解决办法
2017
查看次数

Hubot在发射时挂起/冻结

我可以在命令行中运行时让Hubot工作.但是,当我尝试将它连接到grove.io时,它似乎"挂起"或"冻结".我只得到两行:

[Fri Feb 07 2014 18:23:43 GMT+0000 (UTC)] WARNING The HUBOT_AUTH_ADMIN environment variable not set
[Fri Feb 07 2014 18:23:44 GMT+0000 (UTC)] INFO Data for brain retrieved from Redis
Run Code Online (Sandbox Code Playgroud)

还有什么我需要做的,似乎你不需要为hubot-irc适配器"安装"其他任何东西,只需设置变量即可.我通过机架空间服务器连接到grove.io.

irc hubot

5
推荐指数
1
解决办法
402
查看次数

CoffeeScript - 使用参数执行bash脚本

我正在玩GitHub的Hubot,我尝试在我的机器人工作中执行一个bash脚本.
我成功执行了我的脚本,但如果我在这个脚本中添加一些参数,则无法使其正常工作.

{ spawn } = require 'child_process'
s = spawn './myScript.sh' + " url" + " title"     <------- doesn't work due to args
s = spawn './myScript.sh'                         <------- alright without args
s.stdout.on 'data', ( data ) -> console.log "Output: #{ data }"
s.stderr.on 'data', ( data ) -> console.error "Error: #{ data }"
s.on 'close', -> console.log "'s' has finished executing."
Run Code Online (Sandbox Code Playgroud)

如何将参数传递给我的脚本?
感谢帮助

javascript bash coffeescript hubot

5
推荐指数
1
解决办法
3183
查看次数

Coffeescript正则表达式与预期不匹配

我正在尝试编写一个hubot脚本来回答两种不同的输入。用户可以输入当地公共交通工具的站点名称,也可以选择后缀一下。

因此,输入可以是dvb zellescher wegdvb albertplatz用于第一个选项,dvb zellescher weg in 5dvb albertplatz in 10用于第二个选项。(“ dvb”是我的脚本的关键字,“ zellescher weg”和“ albertplatz”是停止名称的两个示例)

在尝试将它们与regex匹配时,我遇到了一个问题,即我必须在不同的测试站点上工作的regex(例如regex101,似乎在这里建议使用JS),在我的代码中不起作用。/^dvb (\D*)$//dvb\s+(.*)in (\d*)/用来匹配用户输入延迟的情况的正则表达式用于匹配没有数字的输入。

我的hubot的一个最小代码示例由于我不知道的原因而不匹配,如下所示:

robot.respond /^dvb (\D*)$/, (res) ->
    hst = res.match[1]
    res.send hst
Run Code Online (Sandbox Code Playgroud)

感谢您对此的任何帮助。

javascript regex coffeescript hubot

5
推荐指数
1
解决办法
399
查看次数

如何使用密码向Hubo​​t发送私人消息后向用户添加角色

当他能够向Hubo​​t提供正确的密码时,我想为用户添加新角色.

这是我现在的脚本:

module.exports = (robot) ->
  robot.respond /PasswOrd (.*)/, (res) ->
    paSS = res.match[1]
    if paSS is "1234"
      role = 'h1'
      user = robot.brain.userForName(res.message.user.name)
      #CODE TO ADD ROLE h1 FOR THIS USER ???
      res.reply "Correct." + user.id
    else
      res.reply "Incorrect password."
Run Code Online (Sandbox Code Playgroud)

它正确启动 @bot PasswOrd 1234

但我不知道如何添加角色.
谢谢.

hubot rocket.chat

5
推荐指数
0
解决办法
136
查看次数

无法在Heroku上部署Hubot

我在上个月(2月13日)使用hubot 2.4.6在Heroku上部署了一个Hubot实例.

今天我想添加一个新脚本,并在部署回heroku时出现编译错误.在更新之前,我尝试按照wiki说明部署一个全新的hubot导致完全相同的错误,这里是日志:

$ git push heroku master
Counting objects: 23, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (23/23), 10.58 KiB, done.
Total 23 (delta 0), reused 0 (delta 0)

-----> Node.js app detected
-----> Resolving engine versions
       Using Node.js version: 0.10.0
       Using npm version: 1.1.65
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
       npm http GET https://registry.npmjs.org/optparse/1.0.3
       npm http GET https://registry.npmjs.org/hubot
       npm http GET …
Run Code Online (Sandbox Code Playgroud)

heroku node.js hubot

4
推荐指数
1
解决办法
1280
查看次数

Hubot如何在没有任何命令的情况下定期运行功能?

我正在尝试为hubot制作一个函数,每隔5分钟向一个房间发送一条消息而没有任何命令,只需要他自己.

module.exports = (robot, scripts) ->
  setTimeout () ->
    setInterval () ->
      msg.send "foo"
    , 5 * 60 * 1000
  , 5 * 60 * 1000
Run Code Online (Sandbox Code Playgroud)

我需要改变什么?

hubot

4
推荐指数
1
解决办法
1312
查看次数

如何从Hubot执行Shell脚本

我启动并运行了第一个hubot,并根据现有示例编写了前几个脚本。我想与hubot集成的现有工作流程实质上是基于几个shell脚本,每个脚本执行一项任务。该任务可能相对复杂(git / svn签出,使用gcc编译代码并运行它)。如何使用Hubot执行bash脚本?我看到了这个问题,但是它只解决诸如的简单命令ls。我试过了

build = spawn 'source', ['test.sh']
build.stdout.on 'data', (data) -> msg.send data.toString()
build.stderr.on 'data', (data) -> msg.send data.toString()
Run Code Online (Sandbox Code Playgroud)

没有任何运气:

Hubot> execvp(): Permission denied
Run Code Online (Sandbox Code Playgroud)

我检查了明显的内容(-rwxr-xr-x权限),并export HUBOT_LOG_LEVEL="debug"。我与拥有bash脚本的同一用户一起运行hubot。谢谢。

linux bash shell coffeescript hubot

3
推荐指数
2
解决办法
3802
查看次数

hubot不会加载我的hubot-scripts配置

我已经设置了hubot服务器版本2.7.1.这是我的依赖项部分package.json:

"dependencies": {
  "hubot": ">= 2.6.0 < 3.0.0",
  "hubot-scripts": ">= 2.5.0 < 3.0.0",
  "hubot-hipchat": "~2.6.4"
},
Run Code Online (Sandbox Code Playgroud)

当它启动时,它会加载脚本,scripts/但似乎忽略了我放入的集合hubot-scripts.json.这是该文件的第一部分:

["shipit.coffee", "sudo", "9gag", "abstract"
Run Code Online (Sandbox Code Playgroud)

使用详细的启动日志,您可以看到包含shipit.coffee(默认值之一),但其余的都不是:

[Tue Feb 25 2014 10:59:46 GMT-0800 (PST)] DEBUG Loading hubot-scripts from /path/node_modules/hubot-scripts/src/scripts
[Tue Feb 25 2014 10:59:46 GMT-0800 (PST)] DEBUG Parsing help for /path/node_modules/hubot-scripts/src/scripts/shipit.coffee
[Tue Feb 25 2014 10:59:46 GMT-0800 (PST)] DEBUG Loading external-scripts from npm packages
Run Code Online (Sandbox Code Playgroud)

目录中有大约460个文件node_modules/hubot-scripts/src/scripts/,它包含我hubot-scripts.json文件中给出的四个文件.我只能假设它不是在阅读那个文件......或者其他东西.

这个文档差异让我觉得我没有错过任何东西,这是一个很久以前修补过的旧问题.

hubot

3
推荐指数
1
解决办法
1450
查看次数

npm无法说"无法找到VS2010的构建工具"

我正在尝试在我的本地计算机上安装Hubot.到目前为止一直很好,直到我遇到这个错误.错误非常清楚:

一次一个地在此解决方案中构建项目.要启用并行构建,请添加"/ m"开关.

但是我正在运行Hubot Initialization命令Yo Hubot.我无法使用/ m开关.关于我应该做什么的任何建议或建议?

错误屏幕

msbuild npm hubot node-gyp

2
推荐指数
1
解决办法
1338
查看次数

如何在不为每封邮件添加hubot的情况下访问hubot?

我正在使用hubot和hubot-fb适配器开发一个Facebook Messenger机器人。所有基本设置均已完成且工作正常。但是,为了与机器人聊天,我需要在所有命令中添加hubot。如果是Facebook聊天,这没有什么意义。当前聊天看起来像这样:

user: hubot ping
bot: PONG
user: hubot the rules
bot: 0. A robot may not harm humanity, or, by inaction, allow humanity to come to harm.
1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
2. A robot must obey any orders given to it by human beings, except where such orders would conflict with the First Law.
3. A robot must p
Run Code Online (Sandbox Code Playgroud)

但是,我希望我的机器人可以在不使用“ hubot”所有消息的情况下进行访问。我该如何实现?

TIA

javascript hubot facebook-messenger

2
推荐指数
1
解决办法
118
查看次数