peekobot – a simple, choice-driven chatbot framework for your website written in less than 100 lines of vanilla JavaScript (and some CSS)

const chat = {
1: {
text: 'Good morning sir',
next: 2
},
2: {
text: 'Would you like tea or coffee with your breakfast?',
options: [
{
text: 'Tea',
next: 3
},
{
text: 'Coffee',
next: 4
}
]
},
3: {
text: 'Splendid - a fine drink if I do say so myself.'
},
4: {
text: 'As you wish, sir'
}
}