Skip to content

Commit 4a7eee7

Browse files
committed
Clean up using directives and register Configuration
Removed unused namespaces: System.Threading, Telegram.Bot.Types, TelegramBot.Attributes, TelegramBot.Controllers, and System.Collections.Generic. Registered Configuration instance as a singleton service for IConfiguration and IConfigurationRoot interfaces.
1 parent 048a47d commit 4a7eee7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Sources/TelegramBot/Builders/BotBuilder.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
using System;
22
using System.Linq;
33
using Telegram.Bot;
4-
using System.Threading;
5-
using Telegram.Bot.Types;
64
using TelegramBot.Services;
75
using TelegramBot.Providers;
8-
using TelegramBot.Attributes;
96
using TelegramBot.Abstractions;
107
using Microsoft.Extensions.Logging;
118
using Microsoft.Extensions.Hosting;
129
using Microsoft.Extensions.Configuration;
1310
using Microsoft.Extensions.DependencyInjection;
14-
using TelegramBot.Controllers;
15-
using System.Collections.Generic;
1611

1712
namespace TelegramBot.Builders
1813
{
@@ -55,6 +50,9 @@ public BotBuilder(params string[] args)
5550
builder.AddConsole();
5651
builder.AddConfiguration(Configuration.GetSection("Logging"));
5752
});
53+
Services.AddSingleton(Configuration);
54+
Services.AddSingleton<IConfiguration>(Configuration);
55+
Services.AddSingleton<IConfigurationRoot>(Configuration);
5856
}
5957

6058
private string _baseApiUrl = Constants.DefaultBaseApiUrl;

0 commit comments

Comments
 (0)