I try to make a discord bot and i want to implement a voice call soundboard wich can play mp3 files from users. To store these files i need some information about the file. When its finished you should be able to play the files with a command like !sound play test
. My question is: How can i search my JSON file after the Value key?
{
"test":{
"owner":"some-id",
"file":"mathemannsong.mp3",
"stats":{
"played": 0
}
},
"test2":{
"owner":"some-id",
"file":"random.mp3",
"stats":{
"played": 5
}
}
}
This is my JSON file.
I want to search it like this:
cosnt file = require(".file.json")
const name = "test";
const owner = file.name.owner
I know why this dosn`t work.