我们如何知道用户对MS团队做出了哪些反应(喜欢/不喜欢)? [英] How do we get to know to which response user has reacted(like/dislike) on MS teams?

查看:64
本文介绍了我们如何知道用户对MS团队做出了哪些反应(喜欢/不喜欢)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要帮助来了解Microsoft团队如何喜欢和不喜欢BotFramework.当用户单击后台提供的类似选项时,我们将获得reactID,但是我们如何知道用户给出了哪些特定消息的反馈.我们在团队中有这种可行性吗?

We need help in understanding how Microsoft teams like and dislike works with BotFramework. When user clicks on like option provided in background we are getting reactionID but how do we get to know for which specific message user has given his feedback. Do we have this feasibility on Teams?

推荐答案

您可以在replyToId中找到它. 文档中的示例:

You can find it in the replyToId. Example from the docs:

当用户添加或删除他或她对您的漫游器最初发送的消息的反应时,将发送messageReaction事件. replyToId包含特定消息的ID.

The messageReaction event is sent when a user adds or removes his or her reaction to a message which was originally sent by your bot. replyToId contains the ID of the specific message.

{
    "reactionsAdded": [
        {
            "type": "like"
        }
    ],
    "type": "messageReaction",
    "timestamp": "2017-10-16T18:45:41.943Z",
    "id": "f:9f78d1f3",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer-client-ss.msg/",
    "from": {
        "id": "29:1I9Is_Sx0O-Iy2rQ7Xz1lcaPKlO9eqmBRTBuW6XzkFtcjqxTjPaCMij8BVMdBcL9L_RwWNJyAHFQb0TRzXgyQvA",
        "aadObjectId": "c33aafc4-646d-4543-9d4c-abd28e4d2110"
    },
    "conversation": {
        "isGroup": true,
        "id": "19:3629591d4b774aa08cb0887902eee7c1@thread.skype"
    },
    "recipient": {
        "id": "28:f5d48856-5b42-41a0-8c3a-c5f944b679b0",
        "name": "SongsuggesterLocal"
    },
    "channelData": {
        "channel": {
            "id": "19:3629591d4b774aa08cb0887902eee7c1@thread.skype"
        },
        "team": {
            "id": "19:efa9296d959346209fea44151c742e73@thread.skype"
        },
        "tenant": {
            "id": "72f988bf-86f1-41af-91ab-2d7cd011db47"
        }
    },
    "replyToId": "1:19uJ8TZA1cZcms7-2HLOW3pWRF4nSWEoVnRqc0DPa_kY"
}

但是请注意,此replyToId是特定于Teams的,我认为如果您自行设置,它将不会持续存在.有了这些信息后,您可以更新活动.

Note, however, that this replyToId is specific to Teams and I don't believe it will persist if you set it yourself. Once you have that, you can update the activity.

如果您要分析对哪些消息作出反应,则可能要在 Activity Handler 处理消息并将响应添加到您的日志中.我相信这会出现在 OnUnrecognizedActivityTypeAsync .这类似于上一个链接,更新活动.

If you're trying to analyze which messages are reacted to, you might want to log the outgoing activity's Id and Text in TurnContext.OnSendActivities. Then, when a reaction comes in, you can use the new Activity Handler to handle the message and add the reaction to your log. I believe this would come in OnUnrecognizedActivityTypeAsync. This is similar to the previous link, update the activity.

这篇关于我们如何知道用户对MS团队做出了哪些反应(喜欢/不喜欢)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆