microsoft / botbuilder-js

Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
https://github.com/Microsoft/botframework
MIT License
685 stars 281 forks source link

Missing support for adaptiveCard/action type invoke in TeamsActivityHandler #4259

Closed ashwinvc closed 2 years ago

ashwinvc commented 2 years ago

Versions

SDK Version: 4.15.0 NodeJS Version: 12.18.3 Browser Version: Chrome OS: Windows 11

Describe the bug

While writing a JS Bot for Teams, we would be over-riding the handleAdaptiveCardAction method inside the botbuilder/src/teamsActivityHandler.ts file for adaptiveCard/action invokes. However this type of invoke is not being returned in the onInvokeActivity method of the same file and this is affecting the ability to handle such invokes in the latest bots being developed.

Expected behavior

Would need the adaptiveCard/action type of invoke to return an invoke response using the above method.

Screenshots

The following are the requested changes to help override the existing methods: Screenshot (170)

ashwinvc commented 2 years ago

@stevkan @ramfattah can you pls help looking into this as it'll unblock our customers building JS bots

breakingram commented 2 years ago

Hello @ashwinvc, we are investigating.

breakingram commented 2 years ago

Hi @ashwinvc

looks like the adaptiveCard/action type of invoke is already checked in the base class /activityHandler /, in method onInvokeActivity.

https://github.com/microsoft/botbuilder-js/blob/e7d845eeacb32824af93652d07e46aabf30e800e/libraries/botbuilder-core/src/activityHandler.ts#L508

Perhaps the customer could use ActivityHandler to return an invoke response; example using ActivityHandler.onAdaptiveCardInvoke ?

breakingram commented 2 years ago

Update: In .NET SDK, the handleAdaptiveCardAction method is not available in TeamsActivityHandler class. Only in JS SDK.

vcashwin commented 2 years ago

Sure thing. Will work with the ActivityHandler methods. But wouldnt it be easier to add the changes mentioned in the description, since it enables for ease to work with! @ramfattah