BotSharp/src/Infrastructure/BotSharp.Core/Tasks/TaskPlugin.cs

31 lines
1 KiB
C#
Raw Normal View History

2024-02-02 22:36:05 +00:00
using BotSharp.Abstraction.Plugins.Models;
using BotSharp.Abstraction.Tasks;
2024-05-15 22:53:39 +00:00
using BotSharp.Abstraction.Users.Enums;
2024-02-02 22:36:05 +00:00
using BotSharp.Core.Tasks.Services;
using Microsoft.Extensions.Configuration;
namespace BotSharp.Core.Tasks;
public class TaskPlugin : IBotSharpPlugin
{
public string Id => "e1fb196a-8be9-4c3b-91ba-adfab5a359ef";
public string Name => "Agent Task";
public string Description => "Define some specific task templates and execute them. It can been used for the fixed business scenarios.";
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
services.AddScoped<IAgentTaskService, AgentTaskService>();
}
public bool AttachMenu(List<PluginMenuDef> menu)
{
var section = menu.First(x => x.Label == "Apps");
2024-05-15 22:53:39 +00:00
menu.Add(new PluginMenuDef("Task", link: "page/task", icon: "bx bx-task", weight: section.Weight + 8)
{
2024-10-31 19:36:26 +00:00
Roles = new List<string> { UserRole.Root, UserRole.Admin }
2024-05-15 22:53:39 +00:00
});
2024-02-02 22:36:05 +00:00
return true;
}
}