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
EM.next_tick do | |
client.say( | |
text: “Long running task done!”, | |
channel: data.channel | |
) | |
end |
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
hash = { id: 1, name: “Mark”, title: “Unicorn Dev” } | |
client.web_client.files_upload({ | |
title: “Attachment Title”, | |
filetype: “javascript”, | |
content: JSON.pretty_generate(hash).to_s, | |
channels: data.channel, | |
filename: “attachment.json” | |
}) |
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
hash = { id: 1, name: “Mark”, title: “Dev” } | |
client.web_client.files_upload({title: “Attachment Title”, filetype: “javascript”, content: JSON.pretty_generate(hash).to_s, channels: data.channel, filename: “attachment.json”}) |
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-bot’ | |
class HelloWorldBot < SlackRubyBot::Bot | |
match /greet ([A-Za-z]*)/ do |client, data, match| | |
client.say(text: “Hello #{match[1]}”, channel: data.channel) | |
end | |
end | |
HelloWorldBot.run |
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-bot’ | |
class HelloWorldBot < SlackRubyBot::Bot | |
command ‘hello’ do |client, data, match| | |
client.say(text: ‘world!’, channel: data.channel) | |
end | |
end | |
HelloWorldBot.run |
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
source ‘https://rubygems.org' | |
gem ‘slack-ruby-bot’ | |
gem ‘celluloid-io’ |
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
source ‘https://rubygems.org' | |
gem ‘slack-ruby-bot’ | |
gem ‘celluloid-io’ |
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
source ‘https://rubygems.org' | |
gem ‘slack-ruby-bot’ | |
gem ‘celluloid-io’ |
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
source ‘https://rubygems.org' | |
gem ‘slack-ruby-bot’ | |
gem ‘celluloid-io’ |
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
# app/graphql/types/movie_type.rb | |
Types::MovieType = GraphQL::ObjectType.define do | |
name "Movie" | |
field :id, types.ID | |
field :title, types.String | |
field :description, types.String | |
field :reviews do |
NewerOlder