I am Testing the deployment of MS Bot framework application without azure on my own host
My issue is with the Activity Connector as its'nt accepting api calls form telegram as follows:
public async Task<HttpResponseMessage> Post([FromBody]Activity activity)<---
{
if (activity.GetActivityType() == ActivityTypes.Message)
{
await Conversation.SendAsync(activity, () => new Dialogs.RootDialog());
}
else
{
HandleSystemMessage(activity);
}
var response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
here is the webhook i am using:
https://api.telegram.org/bot123456789:ABC../setWebhook?url=https://example.com/api/messages
what am i doing wrong here?
That's because telegram doesn't send the activity of the same type as expected by bot framework. You may try to use activity.Properties
where the json data from telegram are sent. And then deserialize it to custom models. (see this answer )
But it's not a good solution as for me.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.