using BotSharp.Abstraction.Instructs; using BotSharp.Abstraction.Messaging; using BotSharp.Abstraction.Plugins.Models; using BotSharp.Abstraction.Routing.Planning; using BotSharp.Abstraction.Settings; using BotSharp.Abstraction.Templating; using BotSharp.Core.Instructs; using BotSharp.Core.Messaging; using BotSharp.Core.Routing.Planning; using BotSharp.Core.Templating; using Microsoft.Extensions.Configuration; namespace BotSharp.Core.Conversations; public class ConversationPlugin : IBotSharpPlugin { public string Id => "99e9b971-a9f1-4273-84da-876d2873d192"; public string Name => "Conversation"; public string Description => "Provides conversations/ states management, saves dialogue logs, undo dialogs and channel access."; public SettingsMeta Settings => new SettingsMeta("Conversation"); public object GetNewSettingsInstance() => new ConversationSetting(); public void RegisterDI(IServiceCollection services, IConfiguration config) { services.AddScoped(provider => { var settingService = provider.GetRequiredService(); return settingService.Bind("Conversation"); }); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); // Rich content messaging services.AddScoped(); // Register template render services.AddSingleton(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); } public bool AttachMenu(List menu) { var section = menu.First(x => x.Label == "Apps"); menu.Add(new PluginMenuDef("Conversation", link: "/page/conversation", icon: "bx bx-conversation", weight: section.Weight + 5)); return true; } }