forked from BotBuilderCommunity/botbuilder-community-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SlackAdapterBotComponent.cs
25 lines (24 loc) · 1 KB
/
SlackAdapterBotComponent.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
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.Core;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
namespace Bot.Builder.Community.Adapters.Slack
{
/// <summary>
/// <see cref="BotComponent"/> definition for <see cref="SlackAdapter"/>.
/// </summary>
public class SlackAdapterBotComponent : BotComponent
{
/// <inheritdoc/>
public override void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
if (SlackAdapter.HasConfiguration(configuration))
{
// Components require the component configuration which is the subsection
// assigned to the component. When the botbuilder-dotnet issue #5583 gets resolved, this could
// change to the no-parameter overload.
services.AddSingleton<IBotFrameworkHttpAdapter, SlackAdapter>(sp => new SlackAdapter(configuration));
}
}
}
}