0.01
No commit activity in last 3 years
No release in over 3 years
A Ruby client for the Slack API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 10.0
~> 0.25

Runtime

~> 0.11
~> 0.9
~> 1.10
~> 0.19
 Project Readme

Slack::Client

A basic Slack API client written in Ruby. Currently the client returns the raw JSON response it receives from Slack's server.

Installation

Add this line to your application's Gemfile:

gem 'slack-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install slack-client

Usage (API Client)

require 'slack/client'

SLACK_API_TOKEN="<your Slack API token goes here>"

client = Slack::Client.new(token: SLACK_API_TOKEN)

puts client.users.list
puts client.channels.list
puts client.channels.history('C1234567')

Usage (Command-Line App)

We recommend installed jq, a flexible command-line JSON processor. Here are some basic commands:

$ slack help
$ slack config set SLACK_TOKEN="<your Slack API token goes here>"
$ slack users list
$ slack channels info
$ slack channels history C1234567

With jq, you can do things like

$ slack users list | jq '.members | map({(.id): .name})'

which will print out a list of Slack User ID + Name pairs.

Contributing

  1. Fork it (https://github.com/codeunion/slack-client/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request