-
Notifications
You must be signed in to change notification settings - Fork 70
/
SlackEndpoints.cs
24 lines (19 loc) · 1023 Bytes
/
SlackEndpoints.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Functions.Worker;
using SlackNet.AzureFunctions;
namespace AzureFunctionsExample;
public class SlackEndpoints(ISlackFunctionRequestHandler requestHandler)
{
[Function("event")]
public Task<SlackFunctionResult> Event([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest request) =>
requestHandler.HandleEventRequest(request);
[Function("action")]
public Task<SlackFunctionResult> Action([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest request) =>
requestHandler.HandleActionRequest(request);
[Function("options")]
public Task<SlackFunctionResult> Options([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest request) =>
requestHandler.HandleOptionsRequest(request);
[Function("command")]
public Task<SlackFunctionResult> Command([HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest request) =>
requestHandler.HandleSlashCommandRequest(request);
}