Skip to content

Commit

Permalink
Merge branch 'master' into acc-fix-rtm-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
acconrad committed Apr 12, 2019
2 parents 139b8f5 + aace91c commit f54d9d8
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 10 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -4,11 +4,12 @@ Status](https://api.travis-ci.org/BlakeWilliams/Elixir-Slack.svg?branch=master)]
# Elixir-Slack

This is a Slack [Real Time Messaging API] client for Elixir. You'll need a
Slack API token which can be retrieved from the [Web API page] or by creating a
Slack API token which can be retrieved by following the [Token Generation
Instructions] or by creating a
new [bot integration].

[Real time Messaging API]: https://api.slack.com/rtm
[Web API page]: https://api.slack.com/web
[Token Generation Instructions]: https://hexdocs.pm/slack/token_generation_instructions.html
[bot integration]: https://my.slack.com/services/new/bot

## Installing
Expand All @@ -23,7 +24,7 @@ def application do
end

def deps do
[{:slack, "~> 0.14.0"}]
[{:slack, "~> 0.16.0"}]
end
```

Expand Down
Binary file added guides/assets/access-token1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guides/assets/access-token2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions guides/token_generation_instructions.md
@@ -0,0 +1,11 @@
# Token Generation Instructions

1. Visit https://api.slack.com/apps
2. If you have already created your app then click on it, otherwise create a new app.
3. Click on "Add features and functionality" to expand that section
4. Click on "Permissions"
![Step 4](./assets/access-token1.png "Step 4 Screenshot")
5. Copy the "OAuth Access Token"
![Step 5](./assets/access-token2.png "Step 5 Screenshot")

Note: The Elixir Slack library only uses the "OAuth Access Token" or "Bot User OAuth Access Token", it does not use the "Client ID", "Client Secret", "Signing Secret", or "Verification Token"
8 changes: 4 additions & 4 deletions lib/slack.ex
Expand Up @@ -3,11 +3,11 @@ defmodule Slack do
Slack is a genserver-ish interface for working with the Slack real time
messaging API through a Websocket connection.
To use this module you'll need a valid Slack API token. You can find your
personal token on the [Slack Web API] page, or you can add a new
[bot integration].
To use this module you'll need a need a Slack API token which can be retrieved
by following the [Token Generation Instructions] or by creating a new [bot
integration].
[Slack Web API]: https://api.slack.com/web
[Token Generation Instructions]: https://hexdocs.pm/slack/token_generation_instructions.html
[bot integration]: https://api.slack.com/bot-users
## Example
Expand Down
16 changes: 16 additions & 0 deletions lib/slack/web/docs/users.lookupByEmail.json
@@ -0,0 +1,16 @@
{
"desc": "Retrieve a single user by looking them up by their registered email address. Requires `users:read.email`.",

"args": {
"email": {
"type" : "string",
"required" : true,
"desc" : "User's email address"
}
},

"errors": {
"user_not_found" : "Value passed for `user` was invalid.",
"missing_scope" : "The token used is not granted the specific scope permissions required to complete this request. Need: `users:read.email`."
}
}
7 changes: 6 additions & 1 deletion mix.exs
Expand Up @@ -37,7 +37,12 @@ defmodule Slack.Mixfile do
end

def docs do
[{:main, Slack}]
[
{:main, Slack},
{:assets, "guides/assets"},
{:extra_section, "GUIDES"},
{:extras, ["guides/token_generation_instructions.md"]}
]
end

defp package do
Expand Down
4 changes: 2 additions & 2 deletions mix.lock
Expand Up @@ -4,8 +4,8 @@
"cowboy": {:hex, :cowboy, "1.0.4", "a324a8df9f2316c833a470d918aaf73ae894278b8aa6226ce7a9bf699388f878", [:make, :rebar], [{:cowlib, "~> 1.0.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "~> 1.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm"},
"cowlib": {:hex, :cowlib, "1.0.2", "9d769a1d062c9c3ac753096f868ca121e2730b9a377de23dec0f7e08b1df84ee", [:make], [], "hexpm"},
"credo": {:hex, :credo, "0.10.0", "66234a95effaf9067edb19fc5d0cd5c6b461ad841baac42467afed96c78e5e9e", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.2.5", "4d21980d5d2862a2e13ec3c49ad9ad783ffc7ca5769cf6ff891a4553fbaae761", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.1", "519bb9c19526ca51d326c060cb1778d4a9056b190086a8c6c115828eaccea6cf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.7", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"hackney": {:hex, :hackney, "1.13.0", "24edc8cd2b28e1c652593833862435c80661834f6c9344e84b6a2255e7aeef03", [:rebar3], [{:certifi, "2.3.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.2", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
"httpoison": {:hex, :httpoison, "1.2.0", "2702ed3da5fd7a8130fc34b11965c8cfa21ade2f232c00b42d96d4967c39a3a3", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},
"idna": {:hex, :idna, "5.1.2", "e21cb58a09f0228a9e0b95eaa1217f1bcfc31a1aaa6e1fdf2f53a33f7dbd9494", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
Expand Down

0 comments on commit f54d9d8

Please sign in to comment.