WebexPythonSDK icon indicating copy to clipboard operation
WebexPythonSDK copied to clipboard

AdaptiveCard cannot be used as attachment to message

Open raydodds opened this issue 4 years ago • 2 comments

https://github.com/CiscoDevNet/webexteamssdk/blob/49a0a0d07d8d7c11abdf599396c814455261cc76/webexteamssdk/api/messages.py#L244

https://github.com/CiscoDevNet/webexteamssdk/blob/49a0a0d07d8d7c11abdf599396c814455261cc76/webexteamssdk/api/messages.py#L259-L265

In the attachments processing code, an extra s was added on to attachments on line 264.

This checks whether the attachment list is an instance of an AdaptiveCard, which it never will be due to the earlier type check on line 244, rather than checking whether the attachment item is an instance of the AdaptiveCard and makes it impossible to send AdaptiveCards using the intended message.create() functionality.

This can be worked around by importing make_attachment from webexteamssdk.utils and calling that on the card before passing it to messages.create()

raydodds avatar Oct 23 '20 15:10 raydodds

Hi @raydodds

thanks for raising this! You are indeed correct that it does not make sense with the current type check. I will update this.

sQu4rks avatar Oct 23 '20 15:10 sQu4rks

Thanks for your quick response!

raydodds avatar Oct 23 '20 16:10 raydodds

Closing; issue was resolved by #141

cmlccie avatar Feb 19 '24 18:02 cmlccie