Discord Bot Maker

Discord Bot Maker

View Stats:
Putting a variable into a variable?
I've got a bot that, on command, creates a set of variables for a user that are named using their ID and _bp/_ap/_detentions/_isolations. These are formatted as ${tempVars("emtcreateid")}_ap/_bp/_detentions/_isolations and this works fine. I'm working on another command to view the value of the created variables, and so far, it:
- stores the member ID, display name and avatar URL of the mentioned param user
- stores the display name and avatar URL of the command user
- sends an embed including the above as well as the values of the variables
^^^ this is where the problem starts. Because my variables are named using IDs, when trying to view them I need to use the stored ID of the mentioned param user to grab the variable, but that requires a variable in a variable, as follows:

${tempVars("${tempVars("viewemtprofileid")}_ap")}

My attempts have been unsuccessful and I feel like I'm just missing something obvious or whether it's just impossible, but here's the resulting log output:

Starting bot at version: "2.1.5" ? SyntaxError: missing ) after argument list ? at Object.Actions.eval (C:\Users\Test\Desktop\Test\bot.js:1229:17) ? at Object.Actions.evalMessage (C:\Users\Test\Desktop\Test\bot.js:1239:15) ? at Object.action [as Send Message] (C:\Users\Test\Desktop\Test\actions\send_message.js:633:66) ? at processTicksAndRejections (node:internal/process/task_queues:96:5) ? ? C:/Users/Test/Desktop/Test/node_modules/discord.js/src/util/Util.js:427 ? if (typeof data !== 'string') throw new error(errorMessage); ? ^ ? ? RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings. ? at Function.verifyString (C:/Users/Test/Desktop/Test/node_modules/discord.js/src/util/Util.js:427:41) ? at Function.normalizeField (C:/Users/Test/Desktop/Test/node_modules/discord.js/src/structures/MessageEmbed.js:544:19) ? at C:/Users/Test/Desktop/Test/node_modules/discord.js/src/structures/MessageEmbed.js:565:14 ? at Array.map (<anonymous>) ? at Function.normalizeFields (C:/Users/Test/Desktop/Test/node_modules/discord.js/src/structures/MessageEmbed.js:564:8) ? at MessageEmbed.addFields (C:/Users/Test/Desktop/Test/node_modules/discord.js/src/structures/MessageEmbed.js:328:42) ? at MessageEmbed.addField (C:/Users/Test/Desktop/Test/node_modules/discord.js/src/structures/MessageEmbed.js:319:17) ? at Object.action [as Send Message] (C:\Users\Test\Desktop\Test\actions\send_message.js:633:19) ? at processTicksAndRejections (node:internal/process/task_queues:96:5) { ? [Symbol(code)]: 'EMBED_FIELD_VALUE' ? } ? ? Node.js v17.4.0 ?

Thanks in advance for your help!