BotSharp/src/Infrastructure/BotSharp.Core/Routing/RoutingService.InvokeFunction.cs
2023-12-06 21:06:09 -06:00

15 lines
402 B
C#

using BotSharp.Abstraction.Functions;
namespace BotSharp.Core.Routing;
public partial class RoutingService
{
public async Task<bool> InvokeFunction(string name, RoleDialogModel message)
{
var function = _services.GetServices<IFunctionCallback>().FirstOrDefault(x => x.Name == name);
if (function == null) return false;
return await function.Execute(message);
}
}