Share via


NotificationBot.FindMemberAsync Method

Definition

Returns the first Member where predicate is true, and null otherwise.

public System.Threading.Tasks.Task<Microsoft.TeamsFx.Conversation.Member> FindMemberAsync (Func<Microsoft.TeamsFx.Conversation.Member,System.Threading.Tasks.Task<bool>> predicate, Microsoft.TeamsFx.Conversation.SearchScope scope = Microsoft.TeamsFx.Conversation.SearchScope.All, System.Threading.CancellationToken cancellationToken = default);
member this.FindMemberAsync : Func<Microsoft.TeamsFx.Conversation.Member, System.Threading.Tasks.Task<bool>> * Microsoft.TeamsFx.Conversation.SearchScope * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.TeamsFx.Conversation.Member>
Public Function FindMemberAsync (predicate As Func(Of Member, Task(Of Boolean)), Optional scope As SearchScope = Microsoft.TeamsFx.Conversation.SearchScope.All, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Member)

Parameters

predicate
Func<Member,Task<Boolean>>

Find calls predicate once for each member of the installation, until it finds one where predicate returns true. If such a member is found, find immediately returns that member.Otherwise, find returns null.

scope
SearchScope

The scope to find members from the installations. (personal chat, group chat, Teams channel)

cancellationToken
CancellationToken

The cancellation token.

Returns

The first Member where predicate is true, and null otherwise.

Exceptions

Throws when predicate is null.

Applies to