Skip to content

Commit 6733127

Browse files
authored
Merge pull request #141 from sQu4rks/issue-140
Update Cards Handling to check correct attribute for instance of AdaptiveCards (solves #140)
2 parents 2232914 + 25dabe9 commit 6733127

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/user/cards.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Lets dive into a simple example that sends a card to a room
3131
card = AdaptiveCard(body=[greeting, first_name, age], actions=[submit])
3232
3333
api = WebexTeamsAPI()
34-
api.messages.create(text="fallback", roomId="...", cards=card)
34+
api.messages.create(text="fallback", roomId="...", attachments=[card])
3535
3636
The message we send with this code then looks like this in our Webex Teams
3737
client:

webexteamssdk/api/messages.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def create(self, roomId=None, parentId=None, toPersonId=None,
261261
for item, attachment in enumerate(attachments):
262262
check_type(attachment, (dict, AdaptiveCard))
263263

264-
if isinstance(attachments, AdaptiveCard):
264+
if isinstance(attachment, AdaptiveCard):
265265
attachments[item] = make_attachment(attachment)
266266

267267
post_data = dict_from_items_with_values(

0 commit comments

Comments
 (0)