Comments (4)
Are you referring to the Dialogflow function? Did you run into a syntax error when trying to run it?
from dialogflow-conversation-components-nodejs.
The code uses the wrapper for BasicCard
The buttons
property accepts both an array and a single Button
for ease of use (because right now only one button is allowed).
from dialogflow-conversation-components-nodejs.
Yes, I'm referring to the Dialogflow function.
I am setting the buttons property after having already instantiated the BasicCard rather than using it within the "new" function.
E.g.
let basicCard = new BasicCard({
text: cardText
});
basicCard.buttons = [new Button({
title: linkText,
url: linkUrl
})];
Without the square brackets I was getting a malformed response error on sending back the response.
from dialogflow-conversation-components-nodejs.
Yeah, the wrappers are intended to be created just from the constructor.
If you assign to it manually, you will bypass the abstractions and just directly manipulate the raw GoogleActionsV2UiElementsBasicCard
API which can only have buttons
as an array.
You'll have to assign it with an array like you mentioned.
But this isn't really an issue with the sample as the samples don't manipulate the raw API directly and just use the wrappers with the constructor so it's valid.
conv.ask(new BasicCard({
text: `This is a basic card. Text in a basic card can include "quotes" and
most other unicode characters including emoji 📱. Basic cards also support
some markdown formatting like *emphasis* or _italics_, **strong** or
__bold__, and ***bold itallic*** or ___strong emphasis___ as well as other
things like line \nbreaks`, // Note the two spaces before '\n' required for
// a line break to be rendered in the card.
subtitle: 'This is a subtitle',
title: 'Title: this is a title',
buttons: new Button({
title: 'This is a button',
url: 'https://assistant.google.com/',
}),
image: new Image({
url: IMG_URL_AOG,
alt: 'Image alternate text',
}),
}));
from dialogflow-conversation-components-nodejs.
Related Issues (16)
- Validation Errors HOT 5
- Where is the code for firebase when using google actions sdk HOT 1
- Replace surface capability check lines with conv.surface.capabilities.
- Error: unknown response type HOT 3
- How to Use Actions SDK without Firebase HOT 6
- Error getting documents: Error: Unknown response type: HOT 13
- Unable to retrieve parameters from previous context in code HOT 1
- Error Unknown response type Json HOT 2
- FetchError: request to an json Uri of my sap system HOT 4
- how to use without firebase? HOT 1
- Media response MP3 live streaming specifications HOT 1
- Upgrade API AI version HOT 1
- Add Device Screenshots of Components HOT 1
- Sample seems to be broken HOT 9
- In pure node + express without firebase HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dialogflow-conversation-components-nodejs.