Skip to content

[Sample] The reaction buttons sample should be updated to use the SDK's reaction handlers #2229

@tdurnford

Description

@tdurnford

Description

The Bot Framework development team added onMessageReaction, onReactionsAdded , and onReactionsRemoved handlers to the SDK's Activity Handler in v4.5. The handlers check if the incoming activity's type is ActivityTypes.MessageReaction and then checks the activity's reactionsAdded and reactionsRemoved attributes to determine which handler to invoke.

Currently, the Customize Web Chat with Reaction Buttons Sample posts a ActivityTypes.Message activity to the bot and adds the reaction to the activity's value property.

handleDownvoteButton = () => this.props.postActivity({ type: 'message', name: 'evaluate-activity', value: { activityID: this.props.activityID, helpful: -1 } })
handleUpvoteButton = () => this.props.postActivity({ type: 'message', name: 'evaluate-activity', value: { activityID: this.props.activityID, helpful: 1 } })

The sample should be updated to use the new activity type - ActivityTypes.MessageReaction - and add the reaction changes to the activity's reactionsAdded or reactionsRemoved attributes. Mock Bot will probably have to be updated as well to handle these changes.

[Bug]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions