Microsoft Skype bot的消息传递Webhook

问题描述:

我正在设置一个Microsoft Skype机器人,并且希望它能够将消息发布到个人聊天和群组聊天.我在 https://developer.microsoft.com/zh- us/skype/bots/manage ,并选中了消息传递"复选框,但是有一个消息传递Webhook"字段,其中显示将聊天消息和内容发送到的HTTPS URL.如果您具有聊天功能,则为必填".我在这个领域要做什么?没有明显的帮助链接.我需要设置一个Azure网站吗?

I'm setting up a Microsoft Skype bot, and I want to be able to have it post messages to individual and group chats. I have added a bot at https://developer.microsoft.com/en-us/skype/bots/manage and checked the Messaging checkboxes, but there's a field for "Messaging Webhook", which says "The HTTPS URL to send chat messages and content to. Required if you have a chat capability". What do I put in this field? There's no obvious help link. Do I need to set up an Azure website?

Node.js解决方案:

Solution for Node.js:

如果要在本地测试bot,则需要遵循本指南.一旦运行ngrok,您将获得一个HTTPS URL,例如https://62a8271e.ngrok.io.然后,您需要在此URL后面附加/api/calls,即您需要在Skype频道配置中输入的webhook URL,并且环境变量"CALLBACK_URL"将为https://62a8271e.ngrok.io/api/calls.

If you want to test your bot locally, you need to follow the instructions for ngrok described in the comments of this example and this guide. Once you run ngrok, you will obtain a HTTPS URL such as https://62a8271e.ngrok.io. You then need to append /api/calls to this URL, i.e. the webhook URL you need to enter in the Skype channel configurations and as environment variable "CALLBACK_URL" would be https://62a8271e.ngrok.io/api/calls.

如果要在全球范围内测试机器人并将其部署为Azure Web应用程序,则需要用机器人URL替换ngrok URL,即URL的外观应类似于https://yourbot.azurewebsites.net/api/calls.别忘了也将该URL作为环境变量添加到您的Web应用程序设置中.

If you want to test your bot globally and you have deployed it as an Azure web app, you need to replace the ngrok URL with your bot URL, i.e. the URL should look something like https://yourbot.azurewebsites.net/api/calls. Don't forget to add this URL as an environment variable in your web app settings as well.