Skip to content

Instantly share code, notes, and snippets.

View adamjleonard's full-sized avatar

Adam Leonard adamjleonard

View GitHub Profile
EM.next_tick do
client.say(
text: “Long running task done!”,
channel: data.channel
)
end
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”
})
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”})
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
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
source ‘https://rubygems.org'
gem ‘slack-ruby-bot’
gem ‘celluloid-io’
source ‘https://rubygems.org'
gem ‘slack-ruby-bot’
gem ‘celluloid-io’
source ‘https://rubygems.org'
gem ‘slack-ruby-bot’
gem ‘celluloid-io’
source ‘https://rubygems.org'
gem ‘slack-ruby-bot’
gem ‘celluloid-io’
# 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