# newbot-prompts

> Ask the user to enter text in a specific format

Latest version **1.0.1** (published 2020-02-13) · MIT license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2020-02-13 |
| First published | 2019-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 841 KB |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| Author | NewBot |
| Maintainers | webcreative5 |

## Links

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

## Dependencies (6)

- [validator](https://npm.io/package/validator.md) ^10.11.0
- [chrono-node](https://npm.io/package/chrono-node.md) ^1.4.3
- [newbot-formats](https://npm.io/package/newbot-formats.md) ^1.7.1
- [@microsoft/recognizers-text-choice](https://npm.io/package/@microsoft/recognizers-text-choice.md) ^1.1.4
- [@microsoft/recognizers-text-number](https://npm.io/package/@microsoft/recognizers-text-number.md) ^1.1.4
- [@microsoft/recognizers-text-sequence](https://npm.io/package/@microsoft/recognizers-text-sequence.md) ^1.1.4

## Recent versions

- 1.0.1 (latest) — 2020-02-13
- 1.0.0 — 2020-02-12
- 0.22.0 — 2019-04-17
- 0.21.0 — 2019-04-11
- 0.20.0 — 2019-04-11

## README

# Description

Ask the user to enter text in a specific format. the chatbot can ask for :

- An email
- A phone number
- A date
- A confirmation
- A number

# Installation

Install with

`npm install newbot-prompts`

# Use

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

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

export default {
    code,
    skills: {
        prompts
    }
} 
```

# Use in ConverseScript

In `main.converse` : 

## Ask email

```ts
myFunction() {
    email = prompts.email() 
    > { email }
} 
```

## Ask Phone

```ts
myFunction() {
    phone = prompts.phone() 
    > { phone }
} 
```

## Ask Date

```ts
myFunction() {
    date = prompts.time('Give a date') 
    > { date }
} 
```

## Ask Number

```ts
myFunction() {
    number = prompts.number('Give a number') 
    > { number }
} 
```

You can put a minimum and/or maximum :

```ts
myFunction() {
    number = prompts.number('Give a number', {
        min: 0,
        max: 100
    }) 
    > { number }
} 
```

## Ask Confirmation
```ts
myFunction() {
    bool = prompts.confirm('Do you want to buy?') 
    > { bool }
} 
```

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