Making a chatbot

I started making a chatbot as a project but I’m not exactly sure how I will script everything yet.
I’m done with the basics, it gives basic responses like “Greetings” to “Hello” and stuff, basically I made that with a table.
I of course can’t make the table a million items long, so I’m trying to make it self-learning.

Right now, if it doesn’t find the thing in the table, it says “I didn’t understand that, sorry.”
I thought about adding something where you can type in a response to those questions that the bot didn’t understand and it will save them in a DataStore.

Do you think this is a good idea or do you have any other ones for me?
Thank you!

You should structure your tables, so rather than having a big mess of sentences like so:

Sentences = {
"How are you"
-- etc..

You could instead split the sentence up based on what the word is.
e.g ‘Hey, how are you’

‘Hey’ = “Greeting (Grabs attention)”
‘How’ = “Question”
‘Are’ = “verb”
‘you’ = “address (since you adress the chatbot)”

From there, you can re-use these words in other sentences, e.g
‘Hey, what are you doing?’

we already have all the words defined except for ‘what’ and ‘doing’
Categorizing the words then applying logic based on their position in the sentence and the type of word that comes before it etc. would be my approach to a chatbot