-1

I was learning about AIML files with Python. I know I need to use aiml module of Python, but I want to use it with discord.py.

I want to make it so that, suppose I am talking with the bot, and I tell that my dog name is Blake. And there is another person whose dog name would be Tiger. How can I store it? In a db or I should use json files? I can make the sessionID as the user ID. But then, I need some guidance regarding storing all this information...

Sorry for not showing any code that I wrote, because I am not able to understand how can I achieve this. Some help/guidance would be appreciated, so that, the bot would be able to respond, like I ask it, what's my dog's name, then it would answer with Blake...

Thank you

Hunter
  • 188
  • 2
  • 11

2 Answers2

1

To set a predicate in AIML, you should use

<category>
    <pattern>MY DOG IS CALLED *</pattern>
    <template>Ok, I will learn your dog is called <set name="dog"><star/></set></template>
</category>

You can keep track of each person by keep a note of their clientid. Your AIML interpreter should keep a track of these predicates and you don't need to specify how to store them.

Steve Worswick
  • 880
  • 2
  • 5
  • 11
0

Use SQL databases:

Or NoSQL:

  • MongoDB atlas

JSON is not a database, and should not be used as one!!

dank tagg
  • 229
  • 2
  • 7
  • Oh ok, I never used JSON before anyways, I asked about it cz some other people were saying me to use. And also, predicates are set using something like `setPredicate()`, but how can I use it automatically, when a person types in something like, `My dog name is Blake`. Well, I am using predefined AIML files, cz that's what am told to use, soooo do u know of a way I can do that (set predicate) automatically? – Hunter May 05 '21 at 14:21
  • Oh, ok. Haha I thought u did. – Hunter May 05 '21 at 14:54