Skip to content

Instantly share code, notes, and snippets.

@peted70
Last active June 17, 2016 11:15
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 peted70/23abeab9c13a036368bf4744fd80c3dd to your computer and use it in GitHub Desktop.
Save peted70/23abeab9c13a036368bf4744fd80c3dd to your computer and use it in GitHub Desktop.
if (message.Type == "Message")
{
var userid = message?.From?.Id;
// Lookup the user id to see if we have a token already..
var token = _creds.GetToken(userid);
string prompt = "";
if (string.IsNullOrEmpty(token))
{
var loginUri = new Uri($"http://localhost:3978/api/auth/home?UserId={userid}");
prompt = $"Please pay a visit to {loginUri.ToString()} to associate your user identity with your Microsoft Health identity.";
}
else
{
// TODO: implement bot logic here
if (string.IsNullOrEmpty(prompt))
prompt = "Please ask a question to the MS Health Bot";
}
// return our reply to the user
return message.CreateReplyMessage(prompt);
}
else
{
return HandleSystemMessage(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment