Skip to content

Instantly share code, notes, and snippets.

@Tosainu
Created January 22, 2016 16:44
Show Gist options
  • Save Tosainu/193e0cb521ab955aa19b to your computer and use it in GitHub Desktop.
Save Tosainu/193e0cb521ab955aa19b to your computer and use it in GitHub Desktop.
require 'slack-ruby-client'
Slack.configure do |conf|
conf.token = 'TOKEN'
end
client = Slack::RealTime::Client.new
client.on :hello do
puts 'connected!'
end
client.on :message do |data|
case data['text']
when 'にゃーん' then
client.message channel: data['channel'], text:'Λ__Λ'
end
end
client.start!
source 'https://rubygems.org'
gem 'slack-ruby-client'
gem 'eventmachine'
gem 'faye-websocket'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment