-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating readme and adding EventsExample readme
- Loading branch information
Simon Oxtoby
committed
Apr 20, 2021
1 parent
b7903a8
commit e25c944
Showing
6 changed files
with
102 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace SlackNet.EventsExample | ||
{ | ||
public class HomeController : Controller | ||
{ | ||
public IActionResult Index() => View(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<title>SlackNet Events API Example</title> | ||
<style> | ||
body { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
font-family: sans-serif; | ||
color: hsl(0deg 0% 25%); | ||
} | ||
code { | ||
background: hsl(0deg 0% 95%); | ||
padding: 2px; | ||
} | ||
li { | ||
line-height: 2; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>SlackNet Events API Example</h1> | ||
|
||
<h2>What can you do?</h2> | ||
<ul> | ||
<li>Invite your app to a channel and post a message containing <code>test interactivity</code>.</li> | ||
<li>Try the <code>/echo</code> slash command.</li> | ||
<li>Set up a workflow with a test step. Note that this requires a paid Slack workspace.</li> | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# ASP.NET Core Events Example | ||
|
||
## Slack setup | ||
|
||
Start by creating a [Slack app](https://api.slack.com/apps). | ||
|
||
Subscribe to the `message.*` bot events and the `app_home_opened` workspace event. | ||
|
||
Add the following [bot token](https://api.slack.com/authentication/token-types#granular_bot) scopes: `chat:write`, `im:write`. | ||
|
||
Once the application is up and running, fill in the event and interactivity request URLs with https://your-app/slack/event and https://your-app/slack/action respectively. | ||
|
||
To use the slash command example, create a slash command called `/echo` and point it at https://your-app/slack/command. | ||
|
||
To use the workflow example, follow Slack's [Steps from apps](https://api.slack.com/workflows/steps) guide, using `test_step` as the Callback ID when you create the step for your Slack app. | ||
|
||
## Project setup | ||
|
||
Fill in the `ApiToken` and `SigningSecret` settings in `appsettings.json`. | ||
|
||
The application needs to be made publicly available for Slack to be able to interact with it. When running locally, you can use a tool like [ngrok](https://ngrok.com/) get a public URL. | ||
|
||
Alternatively, you can switch to socket mode by following the instructions in the [socket mode example](../SlackNet.SocketModeExample/readme.md), and passing `true` into `UseSocketMode` in `Startup.cs`. | ||
|
||
## Running the example | ||
|
||
Run the `SlackNet.EventsExample` project. It should open a web page with further instructions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters