BotSharp/tests/BotSharp.Plugin.PizzaBot/Functions/GetPizzaPricesFn.cs

19 lines
508 B
C#
Raw Normal View History

2023-08-30 22:40:45 +00:00
using BotSharp.Abstraction.Conversations.Models;
namespace BotSharp.Plugin.PizzaBot.Functions;
public class GetPizzaPricesFn : IFunctionCallback
{
public string Name => "get_pizza_price";
public async Task<bool> Execute(RoleDialogModel message)
{
2023-08-30 23:29:01 +00:00
message.ExecutionData = new
{
2023-09-09 20:13:19 +00:00
cheese_unit_price = "$3.5"
2023-08-30 23:29:01 +00:00
};
2023-08-30 22:40:45 +00:00
message.ExecutionResult = "Pepperoni Pizza: $3.5/slice, Cheese Pizza: $2.5/slice, Margherita Pizza: $3.0/slice";
return true;
}
}