Created
October 28, 2016 18:04
-
-
Save panchiga/cc48ee3542c3f70c3df34656875150e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'slack-ruby-client' | |
TOKEN = ENV["SLACK_TOKEN"] | |
Slack.configure do |config| | |
config.token = TOKEN | |
end | |
client = Slack::RealTime::Client.new | |
client.on :hello do | |
puts '...' | |
end | |
client.on :message do |data| | |
if !data['text'][/しよう(。|\.)*/].nil? | |
client.message channel: data['channel'], text: 'フンス!' | |
else | |
client.message channel: data['channel'], text:'...' | |
end | |
end | |
client.start! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment