Skip to content

Instantly share code, notes, and snippets.

@thiagoavadore
Created June 26, 2020 15:27
Show Gist options
  • Save thiagoavadore/676493e548f4a2f4c8a354abff956c85 to your computer and use it in GitHub Desktop.
Save thiagoavadore/676493e548f4a2f4c8a354abff956c85 to your computer and use it in GitHub Desktop.
def build_response_card(title, subtitle, options):
buttons = None
if options is not None:
buttons = []
for i in range(min(5, len(options))):
buttons.append(options[i])
return {
'contentType': 'application/vnd.amazonaws.card.generic',
'version': 1,
'genericAttachments': [{
'title': title,
'subTitle': subtitle,
'buttons': buttons
}]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment