chaosbot/ChaosBot/Dependency/ServiceBuilder.cs

20 lines
516 B
C#

using ChaosBot.Discord.Services;
using Discord.Commands;
using Discord.WebSocket;
using Microsoft.Extensions.DependencyInjection;
namespace ChaosBot.Dependency
{
public static class ServiceBuilder
{
public static ServiceProvider Create()
{
return new ServiceCollection()
.AddSingleton<DiscordSocketClient>()
.AddSingleton<CommandService>()
.AddSingleton<CommandHandler>()
.BuildServiceProvider();
}
}
}