Slack-ruby-bot makes it all very easy.
Sign up at slack.com, my team is dblockdotorg.slack.com.
This is something done in Slack, under integrations. Create a new bot, and note its API token.
source 'http://rubygems.org'
gem 'slack-ruby-bot'
require 'slack-ruby-bot'
module HiBot
class App < SlackRubyBot::App
end
class Hi < SlackRubyBot::Commands::Base
command 'hi' do |client, data, _match|
client.message text: "hi <@#{data.user}>", channel: data.channel
end
end
end
HiBot::App.instance.run