Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdaptiveCard cannot be used as attachment to message #140

Closed
raydodds opened this issue Oct 23, 2020 · 3 comments
Closed

AdaptiveCard cannot be used as attachment to message #140

raydodds opened this issue Oct 23, 2020 · 3 comments
Assignees

Comments

@raydodds
Copy link

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()

@sQu4rks sQu4rks self-assigned this Oct 23, 2020
@sQu4rks
Copy link
Contributor

sQu4rks commented Oct 23, 2020

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.

@raydodds
Copy link
Author

Thanks for your quick response!

sQu4rks added a commit that referenced this issue Apr 16, 2021
Update Cards Handling to check correct attribute for instance of AdaptiveCards (solves #140)
@cmlccie
Copy link
Collaborator

cmlccie commented Feb 19, 2024

Closing; issue was resolved by #141

@cmlccie cmlccie closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants