Can you show me example of using deletemessage method of Telegram Bot Api fir Net Core. I tried but received error concerning void and library
I got error CS0029 about void to Telegram.Bot.Types.Message
Related
I'm trying Master and Skill bot functionality by calling Microsoft Sample EchoSkillBot from Master Bot developed by me. Call reached Skill bot from Master but while Skill bot replying to Master getting the exception "InternalServerError". Additional note I'm using LUIS to route the conversations to respective Skill and QnA.
Code: (Exception thrown at this code)
await turnContext.SendActivityAsync(
MessageFactory.Text(messageText,
messageText,
InputHints.IgnoringInput),
cancellationToken);
Error:
"{"type":"https://tools.ietf.org/html/rfc7231#section-6.6.1","title":"An error occured while processing your request.","status":500,"traceId":"XXXXX"}"
"Operation returned an invalid status code 'InternalServerError'"
I found the root cause for the exception. In startup.cs I had used Bot framework adapter as
IBotFrameworkHttpAdapter in one place and other place BotFrameworkHttpAdapter. After fixing this Skill reply worked fine.
// Create the Bot Framework Adapter with error handling enabled.
//services.AddSingleton<IBotFrameworkHttpAdapter, AdapterWithErrorHandler>();
services.AddSingleton<BotFrameworkHttpAdapter, AdapterWithErrorHandler>();
services.AddSingleton<BotAdapter>(sp => sp.GetService<BotFrameworkHttpAdapter>()); //Added for Skill bot
I have a simple asp.net mvc web application which listens for a message and replied back with a standard response. It uses the Twilio API and in
Here is the code:
// Code sample for ASP.NET MVC on .NET Framework 4.6.1+
// In Package Manager, run:
// Install-Package Twilio.AspNet.Mvc -DependencyVersion HighestMinor
using Twilio.AspNet.Common;
using Twilio.AspNet.Mvc;
using Twilio.TwiML;
namespace WebApplication1.Controllers
{
public class SmsController : TwilioController
{
public TwiMLResult Index(SmsRequest incomingMessage)
{
var messagingResponse = new MessagingResponse();
messagingResponse.Message("The copy cat says: " +
incomingMessage.Body);
return TwiML(messagingResponse);
}
}
}
For the code to run, Twilio suggests me "While there are a lot of ways to do this, like deploying your application to Azure or AWS, you'll probably want a less laborious way to test your Twilio like ngrok to allow Twilio to Talk to Your ASP.NET Application"
I have used ngrok, which allows me to expose my local environment to the whole public internet which can then be accessed by URL provided by ngrok,
but the free version keeps changing the subdomain whenever I restart my ec2 server (thus restarting the ngrok tunnel).
What I would like to know is I tried an alternate called serveo which allowed me to chose a subdomain for free, but the URL generated it given an error (400) when I send a message to Twilio.
Is there a way around? I m new to the world of asp.net mcv web application and Twilio and would really appreciate some guidance.
I just need this code to keep running so that it can listen for SMS and respond back.
If not, How can I deploy it on AWS? Which would provide me with an URL to feed to the Twilio's console
The reason 'serveo' isn't working is because (I believe) you are using IIS Express which doesn't allow requests with host header's other than localhost.
'ngrok' has a way around that, as does our free VS Extension called Conveyor. Conveyor at the moment has tunnelling in beta, but it is stable and subdomains are fixed. You can download it from the Extensions menu in VS or marketplace. Here's a tutorial for Twilio https://conveyor.cloud/Help/Writing_webhooks_on_localhost_with_Visual_Studio_and_IIS_Express
I am trying to get a JSON from a API using Dreamfactory on Xamarin.Forms project. I was trying before with their API .net but it doesn't work for my cross-platform so I decided to try it with the TODORest Example they got in [1]: https://github.com/xamarin/xamarin-forms-samples/tree/master/Todo/Todo
I changed the URL to my API one and use the user like empty string and the password for my API key . But when I return the Item to await RefreshDataAsync() tell me a error CS0029 and CS4033 last error means await cant be used in a static but is a async method: public static async Task<List<TodoItem>> RefreshDataAsync().
Can someone help me to find another way to connect to Dreamfactory API or why xamarin give me that errors from the xamarin sample?
I have this error message anytime I try to connect to my bot via directline:
There was an error sending this message to your bot: HTTP status code GatewayTimeout
I didn't have this error at first, it just appeared recently and I dont know what to do, please help. My AppID and Passwords are set correctly.
I creating a bot connector using Directline 3.0 API. After starting a new Conversation using DirectlineClient object, I get the StreamUrl. How can I use it to communicate with the Bot? I tried one sample given here.(http://itq.nl/net-4-5-websocket-client-without-a-browser/) but it does not work. #botframework
A new sample using C# + DirectLine v3.0 + WebSockets is currently under review and will soon be merged into the BotBuilder-samples repository.
Take a look to this Pull Request to see the code of the new sample.