Share via


CommandDialog<T>.On<U> 方法

定义

定义对消息的正则表达式匹配项触发的处理程序。

public Microsoft.Bot.Builder.Dialogs.CommandDialog<T> On<U> (System.Text.RegularExpressions.Regex expression, Microsoft.Bot.Builder.Dialogs.ResumeAfter<Microsoft.Bot.Connector.IMessageActivity> handler, Microsoft.Bot.Builder.Dialogs.ResumeAfter<U> resultHandler = default);
member this.On : System.Text.RegularExpressions.Regex * Microsoft.Bot.Builder.Dialogs.ResumeAfter<Microsoft.Bot.Connector.IMessageActivity> * Microsoft.Bot.Builder.Dialogs.ResumeAfter<'U> -> Microsoft.Bot.Builder.Dialogs.CommandDialog<'T>
Public Function On(Of U) (expression As Regex, handler As ResumeAfter(Of IMessageActivity), Optional resultHandler As ResumeAfter(Of U) = Nothing) As CommandDialog(Of T)

类型参数

U

结果处理程序的输入类型。

参数

expression
Regex

要匹配的正则表达式。

handler
ResumeAfter<IMessageActivity>

用于在匹配时调用的处理程序。

resultHandler
ResumeAfter<U>

当处理程序正在创建混沌对话时要调用的可选结果处理程序。

返回

commandDialog。

适用于