A client for the Slack API.
Most of the API methods work by first creating a Slack client
(Slack.client(token)
) and then passing it in to an API call. Note that a
Slack.Client
is only a convenience wrapper for a map with a :token
key.
{:ok, %{"channel" => channel}} =
token
|> Slack.client
|> Slack.Channel.create(name: "mynewchannel")
If available in Hex, the package can be installed as:
- Add
slack
to your list of dependencies inmix.exs
:
```elixir
def deps do
[{:slack_ex, "~> 0.0.14"}]
end
```