-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDevChatterBotTwitchModule.cs
More file actions
30 lines (25 loc) · 1.1 KB
/
DevChatterBotTwitchModule.cs
File metadata and controls
30 lines (25 loc) · 1.1 KB
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
28
29
30
using Autofac;
using DevChatter.Bot.Infra.Twitch.Events;
using TwitchLib.Api;
namespace DevChatter.Bot.Infra.Twitch
{
public class DevChatterBotTwitchModule : Module
{
protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<TwitchFollowerService>().AsImplementedInterfaces().SingleInstance();
builder.Register(ctx =>
{
var api = new TwitchAPI();
var settings = ctx.Resolve<TwitchClientSettings>();
api.Settings.ClientId = settings.TwitchClientId;
api.Settings.AccessToken = settings.TwitchChannelOAuth; // need to verify this as well
return api;
})
.AsImplementedInterfaces();
builder.RegisterType<TwitchChatClient>().AsImplementedInterfaces().SingleInstance();
builder.RegisterType<TwitchStreamingInfoService>().AsImplementedInterfaces().SingleInstance();
builder.RegisterType<TwitchKnownBotService>().AsImplementedInterfaces().SingleInstance();
}
}
}