Hubot
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
#topicpath
----
***コンテンツ一覧 [#ed86a7ca]
#ls2
#contents
**Hubotとは [#i0eb1aea]
[[HUBOT>https://hubot.github.com/]]をつかってみました。Hu...
簡単にいうとSlackなどのチャットツール上で稼働するボットを...
**やってみる [#r10656f2]
Hubotは通常は [[Heroku>https://www.heroku.com/]] にいれる...
なので以下、Dockerが動く環境がある前提で進めます。
# docker pull node
# cat Dockerfile
FROM node
MAINTAINER masatomix
RUN npm install -g yo generator-hubot
RUN useradd bot
RUN mkdir /home/bot && chown bot:bot /home/bot
USER bot
WORKDIR /home/bot
Hubotは Yeomanを使ってテンプレからソースを作りますので、...
# docker build -t hubot-sample .
docker build -t hubot-sample .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM node
---> 47522eb1edb5
Step 2 : MAINTAINER masatomix
---> Using cache
---> a1914d9d0328
Step 3 : RUN npm install -g yo generator-hubot
---> Using cache
---> a47cfa033eb7
Step 4 : RUN useradd bot
---> Running in cd8beb5b849b
---> be2fc2c58d90
Removing intermediate container cd8beb5b849b
Step 5 : RUN mkdir /home/bot && chown bot:bot /home/bot
---> Running in d2c532d64b0b
---> 9421a92d23e7
Removing intermediate container d2c532d64b0b
Step 6 : USER bot
---> Running in 5eb063a6afd7
---> 119c2de9066b
Removing intermediate container 5eb063a6afd7
Step 7 : WORKDIR /home/bot
---> Running in 282c1d3afce7
---> 5f173b929721
Removing intermediate container 282c1d3afce7
Successfully built 5f173b929721
#
# docker images
REPOSITORY TAG IMAGE ID ...
hubot-sample latest 5f173b929721 ...
imageができたので、そこから新しいコンテナを起動します
# docker run -it hubot-sample /bin/bash
bot@8d0968b2a418:~$ node --version
v7.7.3
bot@8d0968b2a418:~$
nodejsがインストールされた環境が起動しました。
ではさっそく Yeomanでソース生成です。Yeomanにはいろいろき...
$ mkdir hubot-sample && cd $_
$ yo hubot
? ======================================================...
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve th...
More info: https://github.com/yeoman/insight & http://ye...
========================================================...
_____________________________
/ \
//\ | Extracting input for |
////\ _____ | self-replication process |
//////\ /_____\ \ /
======= |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
? Owner Masatomix <masatomix@example.com> ←Owner
? Bot name Hubot ← Hubotの名前
? Description A simple helpful robot for your Company
? Bot adapter campfire
create bin/hubot
create bin/hubot.cmd
create Procfile
create README.md
create external-scripts.json
create hubot-scripts.json
create .gitignore
create package.json
create scripts/example.coffee
create .editorconfig
_____________________________
_____ / \
\ \ | Self-replication process |
| | _____ | complete... |
|__\\| /_____\ \ Good luck with that. /
|//+ |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
... 以下略
npm info ok
起動します
$ ./bin/hubot
... 略
npm info ok
[Mon Mar 20 2017 05:49:38 GMT+0000 (UTC)] INFO hubot-red...
Hubot>
起動しました。
** ヘルプを表示 [#t108047e]
コマンドが分からないのでとりあえずヘルプ。
Hubot> hubot help
Hubot> Shell: Hubot adapter - Reply with the adapter
Hubot animate me <query> - The same thing as `image me`,...
Hubot echo <text> - Reply back with <text>
Hubot help - Displays all of the help commands that Hubo...
Hubot help <query> - Displays all help commands that mat...
Hubot image me <query> - The Original. Queries Google Im...
Hubot map me <query> - Returns a map view of the area re...
Hubot mustache me <url|query> - Adds a mustache to the s...
Hubot ping - Reply with pong
Hubot pug bomb N - get N pugs
Hubot pug me - Receive a pug
Hubot the rules - Make sure hubot still knows the rules.
Hubot time - Reply with current time
Hubot translate me <phrase> - Searches for a translation...
Hubot translate me from <source> into <target> <phrase> ...
ship it - Display a motivation squirrel
Hubot>
というわけで話しかけてみましょう。
Hubot> hubot echo Hello World
Hubot> Hello World
Hubot> hubot ping
Hubot> PONG
Hubot> hubot pug me
Hubot> http://28.media.tumblr.com/tumblr_ls9fa8S9lE1qfbm...
Hubot>
パグのリンクはきれてるみたいですが、いろいろ答えてくれる...
ソースはテンプレのままですが、そこをいじる事でいろんな事...
**関連リンク [#r234c9db]
-[[GitHub社謹製! bot開発・実行フレームワーク「Hubot」:...
-[[hubotスクリプトの書き方とサンプル集 | mitc>http://blog...
-[[CentOS 7.2 で Hubot を Docker で動かしてみた - Qiita>h...
-[[dockerでhubotが動作する環境を作る - Qiita>http://qiita...
-[[dockerでhubot + slack - Qiita>http://qiita.com/nabe/it...
-[[こんな僕でも30分でSlackのbotを作れた。 - アラタナエン...
-[[CentOS 7 で Hubot on Docker をやってみたメモ 愛しく切...
-[[robot.respondでmsg.matchを使う場合は単一でもキーワード...
----
この記事は
#vote(おもしろかった[3],そうでもない[0])
#comment
#topicpath
SIZE(10){現在のアクセス:&counter;}
終了行:
#topicpath
----
***コンテンツ一覧 [#ed86a7ca]
#ls2
#contents
**Hubotとは [#i0eb1aea]
[[HUBOT>https://hubot.github.com/]]をつかってみました。Hu...
簡単にいうとSlackなどのチャットツール上で稼働するボットを...
**やってみる [#r10656f2]
Hubotは通常は [[Heroku>https://www.heroku.com/]] にいれる...
なので以下、Dockerが動く環境がある前提で進めます。
# docker pull node
# cat Dockerfile
FROM node
MAINTAINER masatomix
RUN npm install -g yo generator-hubot
RUN useradd bot
RUN mkdir /home/bot && chown bot:bot /home/bot
USER bot
WORKDIR /home/bot
Hubotは Yeomanを使ってテンプレからソースを作りますので、...
# docker build -t hubot-sample .
docker build -t hubot-sample .
Sending build context to Docker daemon 2.048 kB
Step 1 : FROM node
---> 47522eb1edb5
Step 2 : MAINTAINER masatomix
---> Using cache
---> a1914d9d0328
Step 3 : RUN npm install -g yo generator-hubot
---> Using cache
---> a47cfa033eb7
Step 4 : RUN useradd bot
---> Running in cd8beb5b849b
---> be2fc2c58d90
Removing intermediate container cd8beb5b849b
Step 5 : RUN mkdir /home/bot && chown bot:bot /home/bot
---> Running in d2c532d64b0b
---> 9421a92d23e7
Removing intermediate container d2c532d64b0b
Step 6 : USER bot
---> Running in 5eb063a6afd7
---> 119c2de9066b
Removing intermediate container 5eb063a6afd7
Step 7 : WORKDIR /home/bot
---> Running in 282c1d3afce7
---> 5f173b929721
Removing intermediate container 282c1d3afce7
Successfully built 5f173b929721
#
# docker images
REPOSITORY TAG IMAGE ID ...
hubot-sample latest 5f173b929721 ...
imageができたので、そこから新しいコンテナを起動します
# docker run -it hubot-sample /bin/bash
bot@8d0968b2a418:~$ node --version
v7.7.3
bot@8d0968b2a418:~$
nodejsがインストールされた環境が起動しました。
ではさっそく Yeomanでソース生成です。Yeomanにはいろいろき...
$ mkdir hubot-sample && cd $_
$ yo hubot
? ======================================================...
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve th...
More info: https://github.com/yeoman/insight & http://ye...
========================================================...
_____________________________
/ \
//\ | Extracting input for |
////\ _____ | self-replication process |
//////\ /_____\ \ /
======= |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
? Owner Masatomix <masatomix@example.com> ←Owner
? Bot name Hubot ← Hubotの名前
? Description A simple helpful robot for your Company
? Bot adapter campfire
create bin/hubot
create bin/hubot.cmd
create Procfile
create README.md
create external-scripts.json
create hubot-scripts.json
create .gitignore
create package.json
create scripts/example.coffee
create .editorconfig
_____________________________
_____ / \
\ \ | Self-replication process |
| | _____ | complete... |
|__\\| /_____\ \ Good luck with that. /
|//+ |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
... 以下略
npm info ok
起動します
$ ./bin/hubot
... 略
npm info ok
[Mon Mar 20 2017 05:49:38 GMT+0000 (UTC)] INFO hubot-red...
Hubot>
起動しました。
** ヘルプを表示 [#t108047e]
コマンドが分からないのでとりあえずヘルプ。
Hubot> hubot help
Hubot> Shell: Hubot adapter - Reply with the adapter
Hubot animate me <query> - The same thing as `image me`,...
Hubot echo <text> - Reply back with <text>
Hubot help - Displays all of the help commands that Hubo...
Hubot help <query> - Displays all help commands that mat...
Hubot image me <query> - The Original. Queries Google Im...
Hubot map me <query> - Returns a map view of the area re...
Hubot mustache me <url|query> - Adds a mustache to the s...
Hubot ping - Reply with pong
Hubot pug bomb N - get N pugs
Hubot pug me - Receive a pug
Hubot the rules - Make sure hubot still knows the rules.
Hubot time - Reply with current time
Hubot translate me <phrase> - Searches for a translation...
Hubot translate me from <source> into <target> <phrase> ...
ship it - Display a motivation squirrel
Hubot>
というわけで話しかけてみましょう。
Hubot> hubot echo Hello World
Hubot> Hello World
Hubot> hubot ping
Hubot> PONG
Hubot> hubot pug me
Hubot> http://28.media.tumblr.com/tumblr_ls9fa8S9lE1qfbm...
Hubot>
パグのリンクはきれてるみたいですが、いろいろ答えてくれる...
ソースはテンプレのままですが、そこをいじる事でいろんな事...
**関連リンク [#r234c9db]
-[[GitHub社謹製! bot開発・実行フレームワーク「Hubot」:...
-[[hubotスクリプトの書き方とサンプル集 | mitc>http://blog...
-[[CentOS 7.2 で Hubot を Docker で動かしてみた - Qiita>h...
-[[dockerでhubotが動作する環境を作る - Qiita>http://qiita...
-[[dockerでhubot + slack - Qiita>http://qiita.com/nabe/it...
-[[こんな僕でも30分でSlackのbotを作れた。 - アラタナエン...
-[[CentOS 7 で Hubot on Docker をやってみたメモ 愛しく切...
-[[robot.respondでmsg.matchを使う場合は単一でもキーワード...
----
この記事は
#vote(おもしろかった[3],そうでもない[0])
#comment
#topicpath
SIZE(10){現在のアクセス:&counter;}
ページ名: