so I am working on a bot, and I have the following code. I am attempting to get a color name from the args[1]
of the message and use the color name to figure out which emoji link to grab, and have the following code to pull that from the json in the bot -
const store = require(‘./../../items.json’);
// inside module.exports -
const item = args[0];
const col = args[1];
let name = store[item].name;
let price = store[item].price;
let desc = store[item].description;
let emote = store[item].col // trying to grab the emote link from the variable
When put into an embed, it returns “undefined” for the emote variable. The below code is the json bit (in this case, the item variable is fish) -
{
“fish”: {
“name”: “fish”,
“price”: “$1”,
“description”: “<description here>“,
“white”: “https://<white fish emoji link here>”,
“pink”: “https://<pink fish emoji link here”
}
}
I have asked in multiple discord servers, and have looked around online for answers.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…