Skip to content

Instantly share code, notes, and snippets.

@angelobelchior
Created April 27, 2018 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelobelchior/5b7160f7a71cd77f1ecc80c91350ab14 to your computer and use it in GitHub Desktop.
Save angelobelchior/5b7160f7a71cd77f1ecc80c91350ab14 to your computer and use it in GitHub Desktop.
Welcome Message Bot Framework
private async Task ShowWelcomeMessage(Activity activity)
{
if (activity is IConversationUpdateActivity conversationUpdated)
{
var connector = new ConnectorClient(new Uri(activity.ServiceUrl));
foreach (var member in conversationUpdated.MembersAdded ?? Array.Empty<ChannelAccount>())
{
if (member.Id == conversationUpdated.Recipient.Id)
{
var reply = Actions.WelcomeMessage(activity);
await connector.Conversations.ReplyToActivityAsync(reply);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment