LoginSignup
4

More than 5 years have passed since last update.

hubot irc を使うHow To

Posted at

hubot-ircを使うまでのかんたんHowTo.

hubotとhubot-ircのインストール

環境の想定はdebian. nvm インストール済みでv0.6.9のnodeをinstallした状態を想定。

% npm install hubot
% npm install optparse

optparseはなぜか自動で入らなかったので入れた。
hubotを入れたらとりあえず、コマンドにパスを通す。

% export PATH="~/node_modules/.bin:$PATH"
% npm install hubot-irc

起動する

次に、起動時のパス解決のための処理をしておく。
hubotは起動時のscript用ディレクトリのパス解決が割と残念で、hubotコマンドを書き換えるか起動ディレクトリを適切な場所に移動しておくかする必要がある。
書き換えるのはscriptとadapterと色路やらなくちゃ行けなくて割と面倒なので、移動する。

% cd %HOME/node_modules/hubot

ここで起動。hubotの設定項目は、環境変数として与える。

% HUBOT_IRC_NICK=hubooot HUBOT_IRC_SERVER=irc.example.com HUBOT_IRC_ROOMS=#room HUBOT_IRC_PASSWORD=pass hubot -a irc

これで起動できる。

option: hubot-scriptsを使う

hubot-scriptsは普通にnpm installしても利用できない。
自分で$HOME/node_modules/hubot/node_modulesの中に https://github.com/github/hubot-scripts の中身をcloneし、起動ディレクトリでhubot-scripts.jsonを作って

[
    "bing.coffee"
]

みたいに、起動したいscriptを指定すれば、利用できるようになる。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4