MessageRouteBuilderBase<TBuilder>.WithText Method

Definition

Overloads

Name Description
WithText(String)

Adds a selector to the route that matches incoming message activities with text equal to the specified value, ignoring case.

WithText(Regex)

Adds a text pattern selector to the route, matching incoming message activities whose text satisfies the specified regular expression.

WithText(String)

Adds a selector to the route that matches incoming message activities with text equal to the specified value, ignoring case.

public TBuilder WithText(string text);
member this.WithText : string -> 'Builder
Public Function WithText (text As String) As TBuilder

Parameters

text
String

The text to match against the incoming activity's message content. Comparison is case-insensitive. Cannot be null.

Returns

TBuilder

The current builder instance with the added selector for matching Text.

Remarks

This method only matches activities of type 'Message' and will not match other activity types. If the route is marked as agentic, the selector will only match agentic requests as determined by AgenticAuthorization. Use this method to restrict route handling to specific message text values.

Applies to

WithText(Regex)

Adds a text pattern selector to the route, matching incoming message activities whose text satisfies the specified regular expression.

public TBuilder WithText(System.Text.RegularExpressions.Regex textPattern);
member this.WithText : System.Text.RegularExpressions.Regex -> 'Builder
Public Function WithText (textPattern As Regex) As TBuilder

Parameters

textPattern
Regex

The regular expression used to match the text of incoming message activities. Cannot be null. The selector will only match activities whose text property is not null and matches this pattern.

Returns

TBuilder

The current builder instance configured with the specified Text pattern selector.

Remarks

This method only applies the selector to message activities. If the route is marked as agentic, the selector will only match agentic requests. Use this method to restrict route handling to messages whose text matches a specific pattern.

Applies to