BotSharp/tests/BotSharp.Plugin.PizzaBot/Hooks/CommonAgentHook.cs
Haiping Chen 3caa7a5499 HFPlanner
2023-10-30 11:48:18 -05:00

22 lines
662 B
C#

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);
}
}