react-simple-chatbot
react-simple-chatbot copied to clipboard
Integrate with Amazon Lex
Describe the bug I'm hoping to use this component to interact with Amazon Lex. Was working with react-chat-widget but it was proving complicated to cache user answers so that they persist across webpages. With this component by putting cache = true, that solves that issue. Could you please advise how to handle 'submits' and resolve with a response from the API?
Code from using react chat widget
class App extends Component {
componentDidMount(){
addResponseMessage('Hi there, how can I help you?');
}
handleNewUserMessage = async (newMessage) => {
const response = await Interactions.send("lexbot", newMessage);
addResponseMessage(response.message);
};
render(){
return (
<div className="App">
<Widget
handleNewUserMessage={this.handleNewUserMessage}
/>
</div>
);
}
}