Skip to content

Commit 7bae527

Browse files
committed
Move StatisticsSettings to agent
1 parent f87a520 commit 7bae527

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using BotSharp.Abstraction.MLTasks;
22
using BotSharp.Abstraction.Plugins.Models;
33
using BotSharp.Abstraction.Settings;
4+
using BotSharp.Abstraction.Statistics.Settings;
45
using BotSharp.Abstraction.Templating;
56
using BotSharp.Abstraction.Users.Enums;
67
using BotSharp.Core.Agents.Hooks;
@@ -34,6 +35,12 @@ public void RegisterDI(IServiceCollection services, IConfiguration config)
3435
services.AddScoped<IAgentHook, BasicAgentHook>();
3536
services.AddScoped<IBotSharpStatService, BotSharpStatService>();
3637

38+
services.AddScoped(provider =>
39+
{
40+
var settingService = provider.GetRequiredService<ISettingService>();
41+
return settingService.Bind<StatisticsSettings>("Statistics");
42+
});
43+
3744
services.AddScoped(provider =>
3845
{
3946
var settingService = provider.GetRequiredService<ISettingService>();

src/Plugins/BotSharp.Plugin.Dashboard/DashboardPlugin.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ public class DashboardPlugin : IBotSharpPlugin
1616
public void RegisterDI(IServiceCollection services, IConfiguration config)
1717
{
1818
services.AddScoped<IConversationHook, StatsConversationHook>();
19-
services.AddScoped(provider =>
20-
{
21-
var settingService = provider.GetRequiredService<ISettingService>();
22-
return settingService.Bind<StatisticsSettings>("Statistics");
23-
});
2419
}
2520

2621
public bool AttachMenu(List<PluginMenuDef> menu)

0 commit comments

Comments
 (0)