Sha256: 27e9ebb66baa32c9085bbccec116b576588bdd02d6b1e0563676365bd8369e79

Contents?: true

Size: 662 Bytes

Versions: 7

Compression:

Stored size: 662 Bytes

Contents

require 'slack-ruby-client'

Slack.configure do |config|
  config.token = ENV['SLACK_API_TOKEN']
  fail 'Missing ENV[SLACK_API_TOKEN]!' unless config.token
end

client = Slack::Web::Client.new

client.auth_test

client.chat_postMessage(
  channel: '#general',
  as_user: true,
  attachments: [
    {
      fallback: "Ticket #1943: Can't reset my password - https://groove.hq/path/to/ticket/1943",
      pretext: 'New ticket from Andrea Lee',
      title: "Ticket #1943: Can't reset my password",
      title_link: 'https://groove.hq/path/to/ticket/1943',
      text: 'Help! I tried to reset my password but nothing happened!',
      color: '#7CD197'
    }
  ]
)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
slack-ruby-client-0.10.0 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.9.1 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.9.0 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.8.1 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.8.0 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.7.9 examples/new_ticket/new_ticket.rb
slack-ruby-client-0.7.8 examples/new_ticket/new_ticket.rb