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 general_channel = client.channels_list['channels'].detect { |c| c['name'] == 't3' } client.chat_postMessage(channel: general_channel['id'], text: 'Hello World', as_user: true)