The default blueprint for ember-cli addons.
npm install oswald-addonoswald-addon
==============================================================================
This addon is used to implement all supported response types of messages coming from Oswald.
Installation
------------------------------------------------------------------------------
```
ember install oswald-addon
Explanation
------------------------------------------------------------------------------
| Supported types | Component |
| --------------------- |---------------------------|
| Text | oswald/text-message |
| Url (links) | oswald/url-message |
| Button | oswald/button-message |
| Image | oswald/image-message |
| Video | oswald/video-message |
| Map | oswald/map-message |
| Carousel | oswald/carousel-message |
| Json-pretty | oswald/json-pretty-message|
If the type of the message is not known by the message-balloon, the type will be shown as a JSON-pretty message.
Usage
------------------------------------------------------------------------------
Using the diffrent responsetypes is simple by using the oswald messenger component in Ember.js.
> In template.hbs
``
{{ oswald-messenger allResults=allResults chatbot=chatbot sendMessage=(action "sendMessage")}}allResults
> is an array of objects. These will be returned by the chat-API of Oswald.
> The chatbot has this format:``
{
"id":"exampleId",
"token":"exampleToken",
"welcomeCommand":false,
"defaultLocale":"nl",
"widget": {
"primaryColor":"rgb(104, 102, 199)",
"secondaryColor":"rgb(219, 219, 219)"
}
}
> The Action of the component will send the message of a message for example a quick reply or button.
``
{{subtitle}}
{{title}}
{{ oswald-messenger
allResults=allResults
chatbot=chatbot
sendMessage=(action "sendMessage")
}}
{{
input id="message"
value=message
placeholder=placeHolder
autofocus=""
type=inputType
enter=(action "sendMessage" message)
}}
Only if font-awesome is used in your ember application.
``
"dependencies": {
"ember-font-awesome": "^4.0.0-rc.4"
},ember-font-awesome
> Remove the from devDependencies and add it to dependencies`.