# newbot-dialogflow

> DialogFlow in NewBot Framework

Latest version **1.1.1** (published 2019-08-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install newbot-dialogflow
pnpm add newbot-dialogflow
yarn add newbot-dialogflow
bun add newbot-dialogflow
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2019-08-20 |
| First published | 2018-09-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | webcreative5 |

## Links

- npm: https://www.npmjs.com/package/newbot-dialogflow
- npm.io page: https://npm.io/package/newbot-dialogflow

## Dependencies (1)

- [dialogflow](https://npm.io/package/dialogflow.md) ^0.6.0

## Recent versions

- 1.1.1 (latest) — 2019-08-20
- 1.1.0 — 2018-10-11
- 1.0.1 — 2018-09-20
- 1.0.0 — 2018-09-20

## README

# Description

Integrate the DialogFlow skill into NewBot

# Installation

Install with

`npm install newbot-dialogflow`

# Use

1. In your skill, import the package
2. Add the skill in the `skills` property and configure

```js
import dialogflow from 'newbot-dialogflow'
import code from './main.converse'

export default {
    code,
    skills: {
        dialogflow: dialogflowSkill({
            projectId: 'ENTER_PROJECT_ID_HERE',  // https://dialogflow.com/docs/agents#settings,
            sessionId: 'quickstart-session-id',
            languageDefault: 'en-EN', // optionnal
            credentials: 'PATH_TO_JSON_FILE' // https://cloud.google.com/docs/authentication/production
        })
    }
} 
```

# Use in ConverseScript

In `main.converse` : 

## Get Response

```ts
@Intent('input.welcome')  // action name
welcome() {
    > { :intent.response  } // response
} 
```

## Get Response

```ts
@Intent('input.welcome')  // action name
welcome() {
    > Hey { :intent.firstname.value  } // display parameter "firstname"
} 
```

## Get Error

```ts
@Intent('dialogflow.error')
error() {
    > { :intent.error } // display JS error
}
```

---
_Source: https://npm.io/package/newbot-dialogflow · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
