Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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