Closed LazaroOnline closed 4 years ago
Please find some instructions I put together today which worked great. This is the first time I've used this project so the instructions might need improving.
1) Goto https://api.slack.com/apps
2) Click create app
3) Give the app a name and assign it to a workspace
4) Click OAuth & Permissions
(In the left hand menu)
5) Under Scopes click Add an OAuth Scope
and select chat:write:bot
6) At the top click Install App to workspace
7) Click Allow
8) Copy the OAuth Access Token
(top of the page). This is the token you need to pass into the Slack Client.
1) Install-Package SlackAPI
2) Your code should look similar to this:
public static async Task Main(string[] args)
{
const string TOKEN = "YOUR TOKEN HERE"; // token from last step in section above
var slackClient = new SlackTaskClient(TOKEN);
//check you are posting to the right channel
var response = await slackClient.PostMessageAsync("#general", "hello world");
//check the response above if its not working for you
}
Hi @jculverwell Thanks a lot for your steps, I updated the Example page according to your instructions https://github.com/Inumedia/SlackAPI/wiki/Examples
From the project's README.md there is a link to the code examples at: https://github.com/Inumedia/SlackAPI/wiki/Examples
The very first example of how to connect using user/password combination instead of tokens doesn't compile with the last version of the library from NuGet.
this is the example in documentation:
The methods
SlackClient.StartAuth
andSlackClient.AuthSignin
are not found in the class definition.Can you update the doc with a working example for the Auth login? Thank you very much!