daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IConversationUpdateActivity update = message;
  2.         using (var scope = Microsoft.Bot.Builder.Dialogs.Internals.DialogModule.BeginLifetimeScope(Conversation.Container, message))
  3.         {
  4.             var client = scope.Resolve<IConnectorClient>();
  5.             if (update.MembersAdded.Any())
  6.             {
  7.                 foreach (var newMember in update.MembersAdded)
  8.                 {
  9.                     if (newMember.Id != message.Recipient.Id)
  10.                     {
  11.                         var reply = message.CreateReply();
  12.                         reply.Text = $"Welcome {newMember.Name}!";
  13.                         client.Conversations.ReplyToActivityAsync(reply);
  14.                     }
  15.                 }
  16.             }
  17.         }
RAW Paste Data
Top