I am using Discord API on Node JS.
I got a JSON array and I am trying to get the client output the corresponding value for what the user typed inside a json array.
Inside the client.js
let name = (arg[1])
message.author.send('Result: ' + data.name.desc + data.name.code)
Inside the JSON:
{
"Server1": {
"desc": "A Fun Place",
"code": "9021da"
},
"Server2": {
"desc": "A Chill Place",
"code": "90a11d"
}
}
What I am trying to do is giving the user the desc and the code of the server that they type. (There are over 100 of these)