SlideShare a Scribd company logo
1 of 23
Hubot scripting in Slack
Juneyoung Oh
I-ON Communications
2015.08.01
Index of Contents
Purpose of this Presentation
Install Hubot on OSX
Invite Hubot in Slack room
Writing custom script for Hubot (js)
Tips from personal experiences
CAUTION : I will do all this on OSX with Slack, Heroku.
Purpose of this presentation
This presentation for you :
- Want to make fun bot in your slack community
- Who knows little about javascript
- Want to try something fun with js, but do not want to much time
on it
This presentation NOT for you :
- Hardcore programmer who ought know everything running in
background
- Who never heard of javascript (I am not going to talk about js basic
:<)
- Want to write custom script for Hubot in coffee script. (There are
many examples for coffee on web, so go for it :D)
Installing Hubot on OSX
CAUTION : Things NOT going to mention in here, but you need to prepare for
further steps.
- Install node.js on your system
- Install nvm (node version mananger) on your system
Official Hubot installation guide can be found here :
https://hubot.github.com/docs/
This link could be more accurate but I am going to talk about errors I have met while following those
steps.
Installing Hubot on OSX
First, Install `hubot-generator` with `yo`.
Could get following errors. it just need some authority on your system.
Fix this with `sudo` command like :
Installing Hubot on OSX
Now, make a directory for the bot
Move into project directory
Calling hubot!
You could see following on your screen
Installing Hubot on OSX
In Terminal, you should fill some fields to proceed.
[ Fields list ]
- Owner : Bot Owner name, nothing special.
- Bot name : Going to use this name to call this bot. i.e. If your bot name is
‘testbot’, than `testbot what is your name?`
- Description : Nothing special.
- Adapter : Adapters which could use this bot. default is ‘campfire’. However,
you can change this anytime by editing a file named ‘Procfile’
This are sample which I wrote for this
presentation :D
Installing Hubot on OSX
Now, talk about directories & Files.
Can check with `ls` command. It should shows like follow :D
[File List]
- Procfile : can edit ‘Adapter’ options here.
- external-scripts.js : Additional hubot script. User Custom Script Name can be
found here.
- READ.md : This file for git. If you using a service like ‘github’, This document
will be shows at first.
- hubot-scripts.json : Additional hubot script. But these are specific. Details
could be found : https://www.npmjs.com/browse/keyword/hubot-scripts
- scripts(d) : Put your custom script this directory. To use this script, you have to
specify the name on external-script.js
- bin(d) : A directory which has hubot execution file.
Installing Hubot on OSX
Let’s run this :D
For now, a prompt is all. However still hubot can do serveral commands.
Type following command.
remember, this space for your ‘Botname’.
Simple command sample for you.
Now, Let’s connect this with Slack!
Invite Hubot in Slack room
Let’s make this bot work in slack :D
Before start …
- I assume that you already have a slack account
- I assume that you already install heroku tool-belt.
- Official tutorial can be found : https://github.com/slackhq/hubot-slack
1. Let the bot knows our adapter is ‘slack’.
Go to hubot project folder, and open this with `vi` command.
It looks like this.
We need to edit this file. so press ‘a’ or ‘I’ key to switch to ‘insert mode’. check
the left bottom of terminal and you will see…
Invite Hubot in Slack room
2. Replace that line with follow.
If you want to keep the original one, add ‘#’ to the front of the line, so computer
consider that as a comment, not a command.
Than, press ‘esc’ key to manage mode and type ‘:wq’.
‘w’ means ‘write’ and ‘q’ means ‘quit’.
TIPS. In normal mode type ‘:set nu’. now, vi shows line number for you. This
function is quite useful when handling long script.
Invite Hubot in Slack room
3. Deploy this to Heroku.
For further information for Heroku, visit the link : http://www.heroku.com
You will get following as result.
As you can see in the last line, Heroku internally uses git.
So our further jobs should upload and synchronized with that git URL.
In this case,
https://git.heroku.com/testbotapp.git is my heroku git address.
Invite Hubot in Slack room
4. Install Heroku redistogo addon.
Hubot uses redis DB as its brain, so need to install this to Heroku.(do not need to
install redis on your local.)
heroku addons:create (addon name) –app (your app name in Heroku)
green : Heroku command.
orange : variables
purple : which could be skipped (If you have bunch of Heroku apps like me, need
to point specific target application)
* You need to register ACCOUNT INFORMATION to use heroku addons, even
though it is free. It is necessary.
Invite Hubot in Slack room
5-1. Add configurations to Heroku.
To service Slack, it needs to know HEROKU URL and HEROKU_SLACK_TOKEN.
Let’s add.
Go to below URL:
https://{your room}.slack.com/services/new/hubot
After input your bot’s name, get TOKEN from the page.(It is on the top of the
page. Can not be missed)
Invite Hubot in Slack room
5-2. Add configurations to Heroku.
Add information from the Terminal.
HEROKU_URL can be found heroku.com page.
In [Setting] tab, middle of the page [info] section.
Invite Hubot in Slack room
6. Run your bot and meet it in your Slack.
First, need to push our code to heroku. Than, run it!
If you already have other heroku app, need to some extra process.
Move to top folder of your Project. Than type follow before push.
Now run our bot.
As a result, can find bot in slack. See [DIRECT MESSAGES] section.
Writing custom bot script (js)
This pages for custom hubot scripting for javascript, NOT coffee script.
Basic : Write custom script under ‘scripts’ folder .
Writing custom bot script (js)
After, writing script. Edit ‘hubot-scripts.json’ in top folder.
Add your script name without extension.
Left side is my folder structure, and right is contents of hubot-scripts.json.
Writing custom bot script (js)
Finally, use ‘add’, ‘commit’ and ‘push’ command.
Than, ‘heroku open’.
And go to slack, what you can see …
Tips from personal exp
Tips from my experiences.
1. Checking heroku logs.
This will be quite useful, since there are no scripting guides for javascript. By
doing this, can find more information about internal object like message, robot or
adapter.
2. Could not use DOM Elements.
Hubot script can not use ‘document’ Object. (XMLHttpRequest Object also could
not found).
Tips from personal exp
Tips from my experiences.
3. Use ajax with internal API.
For instance, it looks like…
4. In slack, some of APIs are forbidden to bot.
i.e. kick API can not be called by a bot. For more information, refer following
URL : https://api.slack.com/methods
Tips from personal exp
Tips from my experiences.
5. Refer coffee script codes.
There are no documents for javascript. So if you use js, you have to look what
original structure(coffee) is. Refer ‘src’ directory of hubot github.
URL : https://github.com/github/hubot/tree/master/src
Just like coffee, some objects will be found in js version.
i.e. message, brain, robot, user … Can check if you print those in console and read
heroku logs.
Thanks!

More Related Content

What's hot

Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-pythonEric Ahn
 
Gael Le Mignot How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
Gael Le Mignot   How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...Gael Le Mignot   How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
Gael Le Mignot How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...Vincenzo Barone
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksGlen Ogilvie
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmersxSawyer
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
An introduction to Rex - FLOSS UK DevOps York 2015
An introduction to Rex - FLOSS UK DevOps York 2015An introduction to Rex - FLOSS UK DevOps York 2015
An introduction to Rex - FLOSS UK DevOps York 2015Andy Beverley
 
Fullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & TricksFullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & TricksFrances Coronel
 
Riki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivosti
Riki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivostiRiki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivosti
Riki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivostiDevelcz
 
CoffeeScript in 5mins
CoffeeScript in 5minsCoffeeScript in 5mins
CoffeeScript in 5minsMasakuni Kato
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Takayuki Shimizukawa
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceJon Peck
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Herokuronnywang_tw
 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)xSawyer
 
Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話dcubeio
 
How did puppet change our system's life?
How did puppet change our system's life?How did puppet change our system's life?
How did puppet change our system's life?Hung Phung Dac
 
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지KTH, 케이티하이텔
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppetdelimiter
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 

What's hot (20)

Py conkr 20150829_docker-python
Py conkr 20150829_docker-pythonPy conkr 20150829_docker-python
Py conkr 20150829_docker-python
 
Gael Le Mignot How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
Gael Le Mignot   How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...Gael Le Mignot   How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
Gael Le Mignot How To Minimize Cpu And Memory Usage Of Zope And Plone Appli...
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 
Perl Dancer for Python programmers
Perl Dancer for Python programmersPerl Dancer for Python programmers
Perl Dancer for Python programmers
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
An introduction to Rex - FLOSS UK DevOps York 2015
An introduction to Rex - FLOSS UK DevOps York 2015An introduction to Rex - FLOSS UK DevOps York 2015
An introduction to Rex - FLOSS UK DevOps York 2015
 
Fullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & TricksFullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & Tricks
 
Riki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivosti
Riki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivostiRiki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivosti
Riki Fridrich - Grunt, Gulp a spol. - Automatizáciou k maximalizácii lenivosti
 
CoffeeScript in 5mins
CoffeeScript in 5minsCoffeeScript in 5mins
CoffeeScript in 5mins
 
Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015Sphinx autodoc - automated api documentation - PyCon.KR 2015
Sphinx autodoc - automated api documentation - PyCon.KR 2015
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interface
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)PerlDancer for Perlers (FOSDEM 2011)
PerlDancer for Perlers (FOSDEM 2011)
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話Go初心者がGoでコマンドラインツールの作成に挑戦した話
Go初心者がGoでコマンドラインツールの作成に挑戦した話
 
How did puppet change our system's life?
How did puppet change our system's life?How did puppet change our system's life?
How did puppet change our system's life?
 
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
[H3 2012] 우리가 모르는 Node.js로 할 수 있는 몇가지
 
Tame your Infrastructure with Puppet
Tame your Infrastructure with PuppetTame your Infrastructure with Puppet
Tame your Infrastructure with Puppet
 
Perl Dancer, FPW 2010
Perl Dancer, FPW 2010Perl Dancer, FPW 2010
Perl Dancer, FPW 2010
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 

Viewers also liked

Create Your Own Chatbot with Hubot and CoffeeScript
Create Your Own Chatbot with Hubot and CoffeeScriptCreate Your Own Chatbot with Hubot and CoffeeScript
Create Your Own Chatbot with Hubot and CoffeeScriptRob Scaduto
 
ChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robotsChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robotsOlivier Jacques
 
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container DayAmazon Web Services Korea
 
Let's talk ChatOps - Hubot with less CoffeeScript
Let's talk ChatOps - Hubot with less CoffeeScriptLet's talk ChatOps - Hubot with less CoffeeScript
Let's talk ChatOps - Hubot with less CoffeeScriptSarahKowalik
 
Introduction to hubot
Introduction to hubotIntroduction to hubot
Introduction to hubotTencent
 
Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016Geshan Manandhar
 
Chat ops .. a beginner's guide
Chat ops .. a beginner's guideChat ops .. a beginner's guide
Chat ops .. a beginner's guideJason Hand
 
aws/docker/rails를 활용한 시스템 구축/운용 - docker편
aws/docker/rails를 활용한 시스템 구축/운용 - docker편aws/docker/rails를 활용한 시스템 구축/운용 - docker편
aws/docker/rails를 활용한 시스템 구축/운용 - docker편negabaro
 
Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포
Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포
Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포Amazon Web Services Korea
 
今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1
今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1
今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1Nguyen Tuan
 
Landset 8 的雲層去除技巧實作
Landset 8 的雲層去除技巧實作Landset 8 的雲層去除技巧實作
Landset 8 的雲層去除技巧實作鈵斯 倪
 
小魯蛇與他快樂的夥伴
小魯蛇與他快樂的夥伴小魯蛇與他快樂的夥伴
小魯蛇與他快樂的夥伴鈵斯 倪
 
合同勉強会20160821
合同勉強会20160821合同勉強会20160821
合同勉強会20160821Nguyen Tuan
 
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015Amazon Web Services Korea
 
20150419_pbtech_openstack_nyah #pbtech
20150419_pbtech_openstack_nyah #pbtech20150419_pbtech_openstack_nyah #pbtech
20150419_pbtech_openstack_nyah #pbtechume3_
 

Viewers also liked (20)

Create Your Own Chatbot with Hubot and CoffeeScript
Create Your Own Chatbot with Hubot and CoffeeScriptCreate Your Own Chatbot with Hubot and CoffeeScript
Create Your Own Chatbot with Hubot and CoffeeScript
 
ChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robotsChatOps meetup: les humains parlent aux robots
ChatOps meetup: les humains parlent aux robots
 
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
도커의 기초 - 김상필 솔루션즈 아키텍트 :: AWS Container Day
 
When Splunk meets Slack
When Splunk meets SlackWhen Splunk meets Slack
When Splunk meets Slack
 
Let's talk ChatOps - Hubot with less CoffeeScript
Let's talk ChatOps - Hubot with less CoffeeScriptLet's talk ChatOps - Hubot with less CoffeeScript
Let's talk ChatOps - Hubot with less CoffeeScript
 
Introduction to hubot
Introduction to hubotIntroduction to hubot
Introduction to hubot
 
Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016Embrace chatops, stop installing deployment software - Laracon EU 2016
Embrace chatops, stop installing deployment software - Laracon EU 2016
 
ChatOps
ChatOpsChatOps
ChatOps
 
ChatOps with Hubot
ChatOps with HubotChatOps with Hubot
ChatOps with Hubot
 
Chat ops .. a beginner's guide
Chat ops .. a beginner's guideChat ops .. a beginner's guide
Chat ops .. a beginner's guide
 
aws/docker/rails를 활용한 시스템 구축/운용 - docker편
aws/docker/rails를 활용한 시스템 구축/운용 - docker편aws/docker/rails를 활용한 시스템 구축/운용 - docker편
aws/docker/rails를 활용한 시스템 구축/운용 - docker편
 
Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포
Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포
Gaming on AWS - 6. AWS 환경에서의 유연하고 신속한 코드 관리 및 배포
 
今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1
今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1
今日から始める人工知能 × 機械学習 Meetup ライトニングトーク1
 
Landset 8 的雲層去除技巧實作
Landset 8 的雲層去除技巧實作Landset 8 的雲層去除技巧實作
Landset 8 的雲層去除技巧實作
 
小魯蛇與他快樂的夥伴
小魯蛇與他快樂的夥伴小魯蛇與他快樂的夥伴
小魯蛇與他快樂的夥伴
 
合同勉強会20160821
合同勉強会20160821合同勉強会20160821
合同勉強会20160821
 
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
AWS를 활용한 첫 빅데이터 프로젝트 시작하기(김일호)- AWS 웨비나 시리즈 2015
 
20150419_pbtech_openstack_nyah #pbtech
20150419_pbtech_openstack_nyah #pbtech20150419_pbtech_openstack_nyah #pbtech
20150419_pbtech_openstack_nyah #pbtech
 
LINE Bot 作ってみた
LINE Bot 作ってみたLINE Bot 作ってみた
LINE Bot 作ってみた
 
ChatOps@研究室
ChatOps@研究室ChatOps@研究室
ChatOps@研究室
 

Similar to How to build a slack-hubot with js

Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018Berend de Boer
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntukesavan N B
 
Setup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platformSetup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platformAjeet Singh
 
Installation instructions p8p bb bridge
Installation instructions   p8p bb bridgeInstallation instructions   p8p bb bridge
Installation instructions p8p bb bridgeYuri Grin
 
How to install Open Atrium over LAMP stack
How to install Open Atrium over LAMP stackHow to install Open Atrium over LAMP stack
How to install Open Atrium over LAMP stackcercer
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1Vishal Biyani
 
Dexterity in 15 minutes or less
Dexterity in 15 minutes or lessDexterity in 15 minutes or less
Dexterity in 15 minutes or lessrijk.stofberg
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern developmentRoman Veselý
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonCodeOps Technologies LLP
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoinWilliam Chong
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHDavid Stockton
 
Install laravel on openshift
Install laravel on openshiftInstall laravel on openshift
Install laravel on openshiftSamy Saad
 
Drupal theming training
Drupal theming trainingDrupal theming training
Drupal theming trainingdropsolid
 
Creating Openbravo Workspace Widgets
Creating Openbravo Workspace WidgetsCreating Openbravo Workspace Widgets
Creating Openbravo Workspace WidgetsRob Goris
 
Puppet at GitHub / ChatOps
Puppet at GitHub / ChatOpsPuppet at GitHub / ChatOps
Puppet at GitHub / ChatOpsPuppet
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestJoshua Warren
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-startedtutorialsruby
 

Similar to How to build a slack-hubot with js (20)

Behat - Drupal South 2018
Behat  - Drupal South 2018Behat  - Drupal South 2018
Behat - Drupal South 2018
 
Setting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntuSetting up the hyperledger composer in ubuntu
Setting up the hyperledger composer in ubuntu
 
Setup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platformSetup Kubernetes with flannel on ubuntu platform
Setup Kubernetes with flannel on ubuntu platform
 
Installation instructions p8p bb bridge
Installation instructions   p8p bb bridgeInstallation instructions   p8p bb bridge
Installation instructions p8p bb bridge
 
Software Instructions
Software InstructionsSoftware Instructions
Software Instructions
 
How to install Open Atrium over LAMP stack
How to install Open Atrium over LAMP stackHow to install Open Atrium over LAMP stack
How to install Open Atrium over LAMP stack
 
Bettercap
BettercapBettercap
Bettercap
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1
 
Dexterity in 15 minutes or less
Dexterity in 15 minutes or lessDexterity in 15 minutes or less
Dexterity in 15 minutes or less
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern development
 
OpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in PythonOpenWhisk by Example - Auto Retweeting Example in Python
OpenWhisk by Example - Auto Retweeting Example in Python
 
Intro to Github Actions @likecoin
Intro to Github Actions @likecoinIntro to Github Actions @likecoin
Intro to Github Actions @likecoin
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
 
Install laravel on openshift
Install laravel on openshiftInstall laravel on openshift
Install laravel on openshift
 
Drupal theming training
Drupal theming trainingDrupal theming training
Drupal theming training
 
Creating Openbravo Workspace Widgets
Creating Openbravo Workspace WidgetsCreating Openbravo Workspace Widgets
Creating Openbravo Workspace Widgets
 
Puppet at GitHub / ChatOps
Puppet at GitHub / ChatOpsPuppet at GitHub / ChatOps
Puppet at GitHub / ChatOps
 
Behavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWestBehavior & Specification Driven Development in PHP - #OpenWest
Behavior & Specification Driven Development in PHP - #OpenWest
 
PHP
PHP PHP
PHP
 
php-and-zend-framework-getting-started
php-and-zend-framework-getting-startedphp-and-zend-framework-getting-started
php-and-zend-framework-getting-started
 

More from Juneyoung Oh

Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginnersJuneyoung Oh
 
Docker 사내교육 자료
Docker 사내교육 자료Docker 사내교육 자료
Docker 사내교육 자료Juneyoung Oh
 
휴봇-슬랙 OSX 설치
휴봇-슬랙 OSX 설치휴봇-슬랙 OSX 설치
휴봇-슬랙 OSX 설치Juneyoung Oh
 
Github 의 release 기능
Github 의 release 기능Github 의 release 기능
Github 의 release 기능Juneyoung Oh
 
Html5 canvas6 week6n7n8
Html5 canvas6 week6n7n8Html5 canvas6 week6n7n8
Html5 canvas6 week6n7n8Juneyoung Oh
 
Html5 canvas study week1n2
Html5 canvas study week1n2Html5 canvas study week1n2
Html5 canvas study week1n2Juneyoung Oh
 
Tizen installation guide for OSX
Tizen installation guide for OSXTizen installation guide for OSX
Tizen installation guide for OSXJuneyoung Oh
 

More from Juneyoung Oh (7)

Docker introduction for the beginners
Docker introduction for the beginnersDocker introduction for the beginners
Docker introduction for the beginners
 
Docker 사내교육 자료
Docker 사내교육 자료Docker 사내교육 자료
Docker 사내교육 자료
 
휴봇-슬랙 OSX 설치
휴봇-슬랙 OSX 설치휴봇-슬랙 OSX 설치
휴봇-슬랙 OSX 설치
 
Github 의 release 기능
Github 의 release 기능Github 의 release 기능
Github 의 release 기능
 
Html5 canvas6 week6n7n8
Html5 canvas6 week6n7n8Html5 canvas6 week6n7n8
Html5 canvas6 week6n7n8
 
Html5 canvas study week1n2
Html5 canvas study week1n2Html5 canvas study week1n2
Html5 canvas study week1n2
 
Tizen installation guide for OSX
Tizen installation guide for OSXTizen installation guide for OSX
Tizen installation guide for OSX
 

Recently uploaded

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 

How to build a slack-hubot with js

  • 1. Hubot scripting in Slack Juneyoung Oh I-ON Communications 2015.08.01
  • 2. Index of Contents Purpose of this Presentation Install Hubot on OSX Invite Hubot in Slack room Writing custom script for Hubot (js) Tips from personal experiences CAUTION : I will do all this on OSX with Slack, Heroku.
  • 3. Purpose of this presentation This presentation for you : - Want to make fun bot in your slack community - Who knows little about javascript - Want to try something fun with js, but do not want to much time on it This presentation NOT for you : - Hardcore programmer who ought know everything running in background - Who never heard of javascript (I am not going to talk about js basic :<) - Want to write custom script for Hubot in coffee script. (There are many examples for coffee on web, so go for it :D)
  • 4. Installing Hubot on OSX CAUTION : Things NOT going to mention in here, but you need to prepare for further steps. - Install node.js on your system - Install nvm (node version mananger) on your system Official Hubot installation guide can be found here : https://hubot.github.com/docs/ This link could be more accurate but I am going to talk about errors I have met while following those steps.
  • 5. Installing Hubot on OSX First, Install `hubot-generator` with `yo`. Could get following errors. it just need some authority on your system. Fix this with `sudo` command like :
  • 6. Installing Hubot on OSX Now, make a directory for the bot Move into project directory Calling hubot! You could see following on your screen
  • 7. Installing Hubot on OSX In Terminal, you should fill some fields to proceed. [ Fields list ] - Owner : Bot Owner name, nothing special. - Bot name : Going to use this name to call this bot. i.e. If your bot name is ‘testbot’, than `testbot what is your name?` - Description : Nothing special. - Adapter : Adapters which could use this bot. default is ‘campfire’. However, you can change this anytime by editing a file named ‘Procfile’ This are sample which I wrote for this presentation :D
  • 8. Installing Hubot on OSX Now, talk about directories & Files. Can check with `ls` command. It should shows like follow :D [File List] - Procfile : can edit ‘Adapter’ options here. - external-scripts.js : Additional hubot script. User Custom Script Name can be found here. - READ.md : This file for git. If you using a service like ‘github’, This document will be shows at first. - hubot-scripts.json : Additional hubot script. But these are specific. Details could be found : https://www.npmjs.com/browse/keyword/hubot-scripts - scripts(d) : Put your custom script this directory. To use this script, you have to specify the name on external-script.js - bin(d) : A directory which has hubot execution file.
  • 9. Installing Hubot on OSX Let’s run this :D For now, a prompt is all. However still hubot can do serveral commands. Type following command. remember, this space for your ‘Botname’. Simple command sample for you. Now, Let’s connect this with Slack!
  • 10. Invite Hubot in Slack room Let’s make this bot work in slack :D Before start … - I assume that you already have a slack account - I assume that you already install heroku tool-belt. - Official tutorial can be found : https://github.com/slackhq/hubot-slack 1. Let the bot knows our adapter is ‘slack’. Go to hubot project folder, and open this with `vi` command. It looks like this. We need to edit this file. so press ‘a’ or ‘I’ key to switch to ‘insert mode’. check the left bottom of terminal and you will see…
  • 11. Invite Hubot in Slack room 2. Replace that line with follow. If you want to keep the original one, add ‘#’ to the front of the line, so computer consider that as a comment, not a command. Than, press ‘esc’ key to manage mode and type ‘:wq’. ‘w’ means ‘write’ and ‘q’ means ‘quit’. TIPS. In normal mode type ‘:set nu’. now, vi shows line number for you. This function is quite useful when handling long script.
  • 12. Invite Hubot in Slack room 3. Deploy this to Heroku. For further information for Heroku, visit the link : http://www.heroku.com You will get following as result. As you can see in the last line, Heroku internally uses git. So our further jobs should upload and synchronized with that git URL. In this case, https://git.heroku.com/testbotapp.git is my heroku git address.
  • 13. Invite Hubot in Slack room 4. Install Heroku redistogo addon. Hubot uses redis DB as its brain, so need to install this to Heroku.(do not need to install redis on your local.) heroku addons:create (addon name) –app (your app name in Heroku) green : Heroku command. orange : variables purple : which could be skipped (If you have bunch of Heroku apps like me, need to point specific target application) * You need to register ACCOUNT INFORMATION to use heroku addons, even though it is free. It is necessary.
  • 14. Invite Hubot in Slack room 5-1. Add configurations to Heroku. To service Slack, it needs to know HEROKU URL and HEROKU_SLACK_TOKEN. Let’s add. Go to below URL: https://{your room}.slack.com/services/new/hubot After input your bot’s name, get TOKEN from the page.(It is on the top of the page. Can not be missed)
  • 15. Invite Hubot in Slack room 5-2. Add configurations to Heroku. Add information from the Terminal. HEROKU_URL can be found heroku.com page. In [Setting] tab, middle of the page [info] section.
  • 16. Invite Hubot in Slack room 6. Run your bot and meet it in your Slack. First, need to push our code to heroku. Than, run it! If you already have other heroku app, need to some extra process. Move to top folder of your Project. Than type follow before push. Now run our bot. As a result, can find bot in slack. See [DIRECT MESSAGES] section.
  • 17. Writing custom bot script (js) This pages for custom hubot scripting for javascript, NOT coffee script. Basic : Write custom script under ‘scripts’ folder .
  • 18. Writing custom bot script (js) After, writing script. Edit ‘hubot-scripts.json’ in top folder. Add your script name without extension. Left side is my folder structure, and right is contents of hubot-scripts.json.
  • 19. Writing custom bot script (js) Finally, use ‘add’, ‘commit’ and ‘push’ command. Than, ‘heroku open’. And go to slack, what you can see …
  • 20. Tips from personal exp Tips from my experiences. 1. Checking heroku logs. This will be quite useful, since there are no scripting guides for javascript. By doing this, can find more information about internal object like message, robot or adapter. 2. Could not use DOM Elements. Hubot script can not use ‘document’ Object. (XMLHttpRequest Object also could not found).
  • 21. Tips from personal exp Tips from my experiences. 3. Use ajax with internal API. For instance, it looks like… 4. In slack, some of APIs are forbidden to bot. i.e. kick API can not be called by a bot. For more information, refer following URL : https://api.slack.com/methods
  • 22. Tips from personal exp Tips from my experiences. 5. Refer coffee script codes. There are no documents for javascript. So if you use js, you have to look what original structure(coffee) is. Refer ‘src’ directory of hubot github. URL : https://github.com/github/hubot/tree/master/src Just like coffee, some objects will be found in js version. i.e. message, brain, robot, user … Can check if you print those in console and read heroku logs.