コード例 #1
0
 static async IAsyncEnumerable <IUserMessage> EnumerateMessagesAsync(IMessageChannel channel, [EnumeratorCancellation] CancellationToken cancellationToken = default)
 {
     await foreach (var page in channel.GetMessagesEnumerable(_loadMessages))
     {
         foreach (var message in page)
         {
             if (message is IUserMessage userMessage)
             {
                 yield return(userMessage);
             }
         }
     }
 }