I want to have a .json file where I store all the data about the commands and the answers. Is it possible, to convert {"message": "'<@' + msg.mention.members.first().id + '>'"} the message with all its variables so that discord can understand it when calling msg.channel.send? What I have so far is:
{"message": "'<@' + msg.mention.members.first().id + '>'"}
msg.channel.send(commands[i].message);
But Discord displays the message instead of interpreting it. Is there any way of doing so?
Found the answer myself:
msg.channel.send(eval(commands[i].message));
2.1m questions
2.1m answers
60 comments
57.0k users