BotSharp/tests/BotSharp.Plugin.PizzaBot/Hooks/CommonAgentHook.cs

22 lines
662 B
C#
Raw Normal View History

2023-10-30 16:48:18 +00:00
using BotSharp.Abstraction.Agents;
namespace BotSharp.Plugin.PizzaBot.Hooks;
public class CommonAgentHook : AgentHookBase
{
public override string SelfId => string.Empty;
public CommonAgentHook(IServiceProvider services, AgentSettings settings)
: base(services, settings)
{
}
public override bool OnInstructionLoaded(string template, Dictionary<string, object> dict)
{
dict["current_date"] = DateTime.Now.ToString("MM/dd/yyyy");
dict["current_time"] = DateTime.Now.ToString("hh:mm tt");
dict["current_weekday"] = DateTime.Now.DayOfWeek;
return base.OnInstructionLoaded(template, dict);
}
}