- this is the very Ruboty
- expected to deploy to
Heroku
, but you can execute on any environment
- you need to prepare
.env
file - the sample
.env
file is here - install gems
$ bundle install --path vendor/bundle
- it is easy to deploy to
Heroku
-
- create app in
Heroku
- create app in
-
git push heroku master
or integrateHeroku
with yourGitHub
repository
-
- app released, already
Ruboty
is running! - if the dyno of
Ruboty
stops, you scale it
ruboty
ruboty-twitter
ruboty-google_image
- additionally, many gems for
Ruboty
exist
Ruboty
refers the environment variables for configuration- so you should use
Procfile
withforeman
ordotenv
gem
- so you should use
- as a general rule, the logic of bot must be implemented in gem file
- however, you can specify the logic file with
--load
option as below
- however, you can specify the logic file with
$ bundle exec ruboty --load my_ruboty_logic.rb
- so in my case, I create the main file to load, which includes other logic files
- if I wanna modify existing gem file's logic, I override it in the loaded file
- the name of the bot can be defined by environment variable
- as
ROBOT_NAME
- the default bot name is
ruboty
- as
- the operation methods
message.reply(reply_content)
message
is the object of the message which the user says- this method executes
do reply (basic behavior)
message.from_name
message
is the object of the message which the user says- this method returns
from username
- the example statement of replying
message.reply("@#{message.from_name} these are your beers! 🍻🍻🍻🍻🍻")
- the test codes aren't written
- the exception handling isn't written
- so if the exception occurs,
Ruboty
stops all operations
- so if the exception occurs,