-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from treethought/develop
Fix Google Certs, Media Repsonses, Dialogflow Messenger
- Loading branch information
Showing
12 changed files
with
331 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .base import _Response, _ListSelector, ask, tell, event, permission | ||
from .base import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def build_card( | ||
text, | ||
title, | ||
img_url=None, | ||
img_alt=None, | ||
subtitle=None, | ||
link=None, | ||
link_title=None, | ||
buttons=None, | ||
): | ||
|
||
card_payload = {"title": title, "subtitle": subtitle, "formattedText": text} | ||
|
||
if buttons: | ||
card_payload["buttons"] = buttons | ||
|
||
elif link and link_title: | ||
btn_payload = [{"title": link_title, "openUriAction": {"uri": link}}] | ||
card_payload["buttons"] = btn_payload | ||
|
||
if img_url: | ||
img_payload = {"imageUri": img_url, "accessibilityText": img_alt or img_url} | ||
card_payload["image"] = img_payload | ||
|
||
return {"platform": "ACTIONS_ON_GOOGLE", "basicCard": card_payload} |
Oops, something went wrong.