问题标签 [hubot]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1542 浏览

node.js - Hubot with hipchat adapter not starting on ubuntu

I'm not very well versed in nodejs, but I'm trying to install hubot and run it with the hipchat adapter but, I'm getting the following error, package.json below.

I've followed this tutorial, http://theprogrammingbutler.com/blog/archives/2011/10/28/hipchat-hubot-and-me/ and the official one in the hubot-hipchat repo, https://github.com/hipchat/hubot-hipchat - I even tried setting it up on heroku to no avail. I'd prefer to set it up on my ubuntu 12.04 ec2 instance though, but if someone has a surefire way to heroku it's no problem :) Any help is greatly appreciated!

I've set the following environment variables also.

Error:

package.json

0 投票
1 回答
629 浏览

git - Heroku 应用程序可自动从 GitHub 进行部署

Heroku 是否允许应用程序在内部git clone(例如,通过简单的 bash 脚本)本地远程存储库并推送到其他可用的远程?

我正在考虑编写一个自动(但手动触发)的 hubot 脚本

为此,在 Heroku 上,您应该能够:

  1. 运行命令(例如,git
  2. 将克隆的存储库保存在文件系统中

谢谢。

更新

根据本杰明的回答,我尝试如下,但这似乎并没有在会话之间保留文件。有任何想法吗?

0 投票
1 回答
121 浏览

coffeescript - 循环内的函数

我正在尝试为hubot编写一个脚本来获取游戏的玩家统计数据,但是我在列表理解方面遇到了一些麻烦。

这是我的代码

运行此程序时,我得到“Hello,world!2”,然后是几个“Hello,world!1”,没有“Hello,world!3”,因为列表(可能)是空的。

该脚本在我这样做msg.send而不是尝试捕获数组中的列表时起作用,但是我也想根据排名对列表进行排序。

0 投票
2 回答
4086 浏览

linux - 如何从hubot执行shell脚本

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

没有任何运气:

我检查了明显的东西(-rwxr-xr-x权限),并且export HUBOT_LOG_LEVEL="debug". 我正在使用拥有 bash 脚本的同一用户运行 hubot。谢谢。

0 投票
1 回答
9439 浏览

hubot - 无法安装 hubot - 未满足 npm 依赖项

在尝试部署 hubot 时,npm 不断抱怨未满足的依赖项。该文档没有解释如何解决这个问题。

packages.json 文件包含一个依赖项列表,我认为应该自动解决这些依赖项。

谁能解释一下为什么 npm 不能安装 hubot?

更新

我仍然不明白为什么它不起作用,但是在运行npm install之前运行npm install -g hubot coffee-script似乎可以克服这个错误。在发布答案之前,我需要验证这一点

0 投票
2 回答
7099 浏览

javascript - SyntaxError:保留字“功能”

我正在尝试为 Github 的 Hubot 编写一个脚本,该脚本使用 TooTallNate 的 Node-Spotify-Web 通过 spotify 播放音乐,而且我对 CoffeeScript 有点陌生(Hubot 脚本是用什么编写的)。我在这里写出了第一个命令“播放”:

http://pastebin.com/Pp6mqucm

在运行 bin/hubot 时,我收到错误“语法错误,保留字”“功能”,所以我说,好的,并将“功能”更改为“->”,正如另一个 StackOverflow 问题中的建议。使它看起来像:

http://pastebin.com/dEw0VrH5

但仍然得到错误

错误无法加载/home/xbmc/cbot/lisa/scripts/spotify:语法错误:保留字“函数”

是因为依赖吗?我真的被困在这里了。

0 投票
1 回答
1018 浏览

node.js - 在 Ubuntu 中本地测试 Hubot

嗨 Stackoverflow 社区,

好吧,我正在为hubot编写一个脚本。在开始编码之前,我正在尝试在命令行中测试一些 hubot 命令(我已经在 Windows 中做过,但由于某些原因,我必须更改为 Ubuntu 环境才能开始编写这个全新的自定义 hubot)我想要能够在终端中写入>Hubot PING并得到响应PONG以开始工作。

到目前为止,我已经通过nodenv https://github.com/OiNutter/nodenv安装了 Node.js,并且我测试了我的节点>node -v,得到了v0.10.22. 我分叉了我的hubot并在本地克隆,然后申请~./hubot> npm install获取所有依赖项,一切似乎都很好。然后我去了安装文件夹,该文件夹在hubot>cd node_modules/hosted-hubot文件夹内有一个名为bin的文件夹。

因此,到目前为止,一切似乎都还不错,我尝试在命令行中执行:./bin/hubot并且我无法在本地运行 hubot,它给了我:nodeenv: version `v0.8' is not installed。我尝试安装旧版本的节点0.8并得到相同的消息。

就是这样,希望你们能帮助我尝试在本地测试我的hubot

提前致谢!!!

0 投票
0 回答
688 浏览

openfire - 在 openfire 服务器上设置 hubot

我正在运行 Ubuntu,我正在尝试让一个hubot连接到我的本地 openfire 服务器。我按照这里的教程进行操作,直到最后一切都很顺利,在编辑依赖项后,我运行npm install并收到两个警告:

我不确定不支持存储库意味着什么,我尝试npm install node-stringprep了一个node-gyp rebuild. npm install 给了我同样的警告,但成功完成,而重建给了我这个错误输出:

由于它们是警告而不是错误(在 npm 安装上),我继续并启动了 hubot 以查看它是否会连接,但它没有。我没有从中得到任何错误,但它没有连接。我运行机器人时的输出:

什么也没有发生。

我多次检查了所有 hubot xmpp 字段以确保它们是正确的,虽然这个特定的输出没有它,但我尝试了几种用户名 ->hubot@jake-lenovo-g580和的变体hubot@jake-Lenovo-G580,以便它与我的域匹配。

非常感谢任何帮助。

0 投票
1 回答
145 浏览

node.js - Strange behavior in my Hubot adapter in coffeescript on nodejs

I'm working on a Hubot adapter for my corporate chat system. The output of the following code is quite surprising, I'm not sure where to go next. There is no runtime error (as far as I can tell)

Output:

Code:

0 投票
1 回答
841 浏览

xmpp - How can I get the timestamp of a XMPP chat message that's sent to Hubot?

I'm using an Openfire server to support Jabber chat between Spark clients. I want to use GitHub's Hubot to monitor chatrooms and listen for users to send messages to Hubot, then log the messages. I'm having a hard time figuring out how I can get the timestamp of the message from the point of view of the Openfire server... is this even possible or should I just use the system time of the system running Hubot?