Closed atishwarchand closed 3 years ago
Try:
props.questions[questionIndex]
You can find an options css file example here: https://github.com/FredrikOseberg/react-chatbot-kit-docs/blob/master/src/bots/skybot/widgets/Options/Options.css
@FredrikOseberg bro thanks so much for the quick response.
It worked, but when i click on next question, i get this error..
Plus any hints on how can i have this floating button on my project... please
let [questionIndex, setQuestionIndex] = useState(0);
const incrementIndex = () =>
setQuestionIndex((prev) => (prev.questionIndex += 1));
You're trying to access prev.questionIndex, which will fail because prev is not an object. It's a number. Do this instead:
const incrementIndex = () =>
setQuestionIndex((prev) => (prev += 1));
The button is just a button that's fixed with CSS to be in that position. That site is open source, you can find the code for that here and see how I did it: https://github.com/FredrikOseberg/react-chatbot-kit-docs
@FredrikOseberg thanks so much, love the Chatbot.
Final Help would be really appreciated, is it possible to make the chatbot to redirect a user to some pages... example when user types "help", the bot should give a message redirecting and redirect to help page on the site.
In this same project would like to implement this feature... help would be appreciated
Yes you can. You can for instance push to history in a widget or the actionprovider. If you are using react router you can use useHistory hook to get access to it.
Hello @FredrikOseberg
Followed all the steps in your Youtube video: https://youtu.be/vTpk-PKZwTs?list=PL_kr51suci7UQAxHOF2GitkM5WrOBPcpf
But I am getting this error for what reasons idk.
Can you help me with this please..
Quiz.js
config.js
option.js
MessageParser.js
ActionProvider.js
Also requesting if you could share the css file for options.css which you used in the same video tutorial would be appreciated.