FredrikOseberg / react-chatbot-kit

MIT License
299 stars 139 forks source link

How to check with the validations ? #57

Closed susmitha01 closed 3 years ago

FredrikOseberg commented 3 years ago

Hi there!

You can pass a function to the chatbot to check if the client message is valid or not:

const validator = (input) => {
     if (input.length > 3) return true;
     return false
}

<Chatbot messageParser={messageParser} config={config) actionProvider={actionProvider} validator={validator} />