This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[LuisIntent(RoomBookingIntent)] | |
public async Task RoomBooking(IDialogContext context, | |
LuisResult result) | |
{ | |
var form = new FormDialog<RoomBookingDialog.RoomBookingRequest>( | |
new RoomBookingDialog.RoomBookingRequest(), | |
RoomBookingDialog.RoomBookingRequest.BuildForm, | |
FormOptions.PromptInStart, | |
result.Entities); | |
context.Call(form, RoomBookingResumeAfterCallback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task RoomBookingResumeAfterCallback(IDialogContext context, IAwaitable<RoomBookingDialog.RoomBookingRequest> result) | |
{ | |
RoomBookingDialog.RoomBookingRequest roomBookingRequest = null; | |
try | |
{ | |
roomBookingRequest = await result; | |
} | |
catch (FormCanceledException<RoomBookingDialog.RoomBookingRequest> e) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public class PartialMessage | |
{ | |
public string Text { set; get; } | |
public string FromName { set; get; } | |
} | |
protected override async Task MessageReceived( | |
IDialogContext context, IAwaitable<IMessageActivity> item) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<Message> Post([FromBody]Message message) | |
{ | |
if (message.Type == “Message”) | |
{ | |
message.BotPerUserInConversationData = null; | |
return await Conversation.SendAsync(message, () => new PersonInfoNaturalLanguageDialog()); | |
} | |
return HandleSystemMessage(message); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Serializable] | |
public class EchoDialog : IDialog<object> | |
{ | |
public async Task StartAsync(IDialogContext context) | |
{ | |
context.Wait(MessageReceivedAsync); | |
} | |
public async Task MessageReceivedAsync(IDialogContext context, IAwaitable<Message> argument) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[LuisIntent(“WhoIs”)] | |
public async Task WhoIs(IDialogContext context, LuisResult result) | |
{ | |
var response = await GetWhoIsResponse(result.Entities.First()); | |
await context.PostAsync(response); | |
context.Wait(MessageReceived); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SlackWebHookHandler : WebHookHandler | |
{ | |
private readonly IUserService _userService; | |
public SlackWebHookHandler() | |
{ | |
Receiver = SlackWebHookReceiver.ReceiverName; | |
var httpClient = new HttpClientWrapper(); | |
_userService = new TimezoneUserService(httpClient); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ServiceDataResponse<T> : ServiceResponse | |
where T : class | |
{ | |
public bool Success { get; set; } | |
public string ErrorMessage { get; set; } | |
public T Data { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserDetail | |
{ | |
public string FirstName { get; set; } | |
public string LastName { get; set; } | |
public string FullName | |
{ | |
get { return FirstName + " " + LastName; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load basic support for sending WebHooks | |
config.InitializeCustomWebHooks(); | |
// Use SQL for persisting subscriptions | |
config.InitializeCustomWebHooksSqlStorage(); | |
// Load Web API controllers for managing subscriptions | |
config.InitializeCustomWebHooksApis(); |