-
Notifications
You must be signed in to change notification settings - Fork 70
/
Program.cs
27 lines (23 loc) · 917 Bytes
/
Program.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
25
26
27
using AzureFunctionsExample;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using SlackNet.AzureFunctions;
using SlackNet.Events;
var host = new HostBuilder()
.ConfigureFunctionsWebApplication(builder =>
{
builder.UseSlackNet();
})
.ConfigureServices((hostContext, services) =>
{
services.AddSlackNet(c => c
// Configure the token used to authenticate with Slack
.UseApiToken(hostContext.Configuration["SlackApiToken"]!)
// The signing secret ensures that SlackNet only handles requests from Slack
.UseSigningSecret(hostContext.Configuration["SlackSigningSecret"]!)
// Register your Slack handlers here
.RegisterEventHandler<MessageEvent, PingDemo>()
);
})
.Build();
host.Run();