In local bot work perfectly fine but on web chat channel 'There was an error sending this message to your bot: HTTP status code Gateway Timeout' error occurred but bot run correctly after 2nd respond
Controller code
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)
{
if (activity.Type == ActivityTypes.Message)
{
await Conversation.SendAsync(activity, () => new EchoDialog());
}
else if (message.Type == ActivityTypes.ConversationUpdate)
{
// Handle conversation state changes, like members being added and removed
// Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
// Not available in all channels
IConversationUpdateActivity iConversationUpdated = message as IConversationUpdateActivity;
if (iConversationUpdated != null)
{
ConnectorClient connector = new ConnectorClient(new System.Uri(message.ServiceUrl));
foreach (var member in iConversationUpdated.MembersAdded ?? System.Array.Empty<ChannelAccount>())
{
// if the bot is added, then
if (member.Id == iConversationUpdated.Recipient.Id)
{
var reply = ((Activity)iConversationUpdated).CreateReply("Hi, Welcome to Systenics.");
await connector.Conversations.ReplyToActivityAsync(reply);
await Conversation.SendAsync(message, () => new EchoDialog());
}
}
}
}
else
{
await HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
Chat dialog
public async Task StartAsync(IDialogContext context)
{
context.Wait(this.ShowOptions);
}
public virtual async Task ShowOptions(IDialogContext context, IAwaitable<IMessageActivity> activity)
{
var message = await activity;
var descriptions = new string[] { "Request a Quote", "More Information About Jobs" };
PromptDialog.Choice(
context: context,
resume: ChoiceReceivedAsync,
options: descriptions,
prompt: "Please select an option below:",
retry: "Selected option not available.",
promptStyle: PromptStyle.Auto
);
}