BotSharp/src/Infrastructure/BotSharp.Core/Instructs/InsturctionPlugin.cs

33 lines
1 KiB
C#
Raw Normal View History

2025-02-21 04:52:02 +00:00
using BotSharp.Abstraction.Plugins.Models;
2025-03-05 23:22:46 +00:00
using BotSharp.Abstraction.Users.Enums;
2025-02-21 04:52:02 +00:00
using Microsoft.Extensions.Configuration;
namespace BotSharp.Core.Instructs;
public class InsturctionPlugin : IBotSharpPlugin
{
public string Id => "8189e133-819c-4505-9f82-84f793bc1be0";
public string Name => "Instruction";
public string Description => "Handle agent instruction request";
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
}
public bool AttachMenu(List<PluginMenuDef> menu)
{
var section = menu.First(x => x.Label == "Apps");
2025-03-05 23:22:46 +00:00
menu.Add(new PluginMenuDef("Instruction", icon: "bx bx-book-content", weight: section.Weight + 5)
{
SubMenu = new List<PluginMenuDef>
{
new PluginMenuDef("Instruction", link: "page/instruction"),
new PluginMenuDef("Log", link: "page/instruction/log") { Roles = [UserRole.Root, UserRole.Admin] }
}
});
2025-02-21 04:52:02 +00:00
return true;
}
}