Skip to content

Commit

Permalink
Changes made to title usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Stewart committed Mar 19, 2018
1 parent f44175e commit 988f849
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions alexa/__init__.py
Expand Up @@ -318,7 +318,7 @@ def __init__(self, title):
"response": {}
}

def card(self, text, image=None, permissions=None):
def card(self, text,title=None, image=None, permissions=None):
"""Create a card response.
Allows a card to be sent as part of the response. This will show up in the users Alexa app
Expand All @@ -328,6 +328,8 @@ def card(self, text, image=None, permissions=None):
Additionally, you can pass in a dict with small and large as keys with alternate URLs
"""
# If image is set
if not title:
title = self.skill_title

if permissions is not None:
self.final_response['response']['card'] = {
Expand Down Expand Up @@ -356,7 +358,7 @@ def card(self, text, image=None, permissions=None):
# set the response card value to the values in the image_carg
self.final_response['response']['card'] = {
"type": "Standard",
"title": self.skill_title,
"title": title,
"text": text,
"image": card_img
}
Expand All @@ -365,7 +367,7 @@ def card(self, text, image=None, permissions=None):
# Create a response card object reflective of no image being se
self.final_response['response']['card'] = {
"type": "Simple", # Card type
"title": self.skill_title, # Card title
"title": title, # Card title
"content": text # Content dict
}

Expand Down

0 comments on commit 988f849

Please sign in to comment.