I am trying to create a command where I can read a JSON array with multiple properties (for example - prompt, response). I want to be able to get a random prompt response pair from that array and stagger the responses so it feels like a question is asked and then a response is given.
I think I know how to use vxrl.xyz/smm to stagger the responses, but I am stuck on how to get a random prompt response pair from the JSON array.
Example of what my JSON data looks like:
[
{
"prompt": "Prompt01",
"response": "Response01"
},
{
"prompt": "Prompt02",
"response": "Response02"
},
{
"prompt": "Prompt03",
"response": "Response03"
}
]
Example of expected output in the chat:
User: !command
Nightbot: Prompt02
Nightbot: Response02 (after 5-10 seconds)
Thanks in advance for the help!