let user = message.mentions.users.first();
if (message.mentions.users.size < 1) return message.reply('Вы должны упомянуть кого-нибудь, чтобы выдать АРы.').catch(console.error);
mcash[${user.id}, ${message.guild.id}].mcash++;
fs.writeFile("./usercash.json", JSON.stringify(mcash), err => {
if(err) throw err;
});
member.roles.cache.has('899099537979899924');
member.roles.cache.some(role => role.name === 'Банкир');
let pcash = args.slice(1).join(" ");
if(!pcash) pcash = "Не указана"
const embed = new Discord.MessageEmbed()
.setDescription('Пополнение из банка:', alert(mcash))
.setThumbnail('https://media.discordapp.net/attachments/899085238955806742/899102776263573574/200.png?width=180&height=180')
message.author.send( {embeds:[embed] });
}});
The code must retain the amount entered along with the mention. Further, the value that was written earlier was added to the variable, but an error is displayed.
mcash[${user.id}, ${message.guild.id}].mcash++;
The usage of ${} only function inside of a template literal, the use of it isn't needed here, so it can be changed to:
mcash[user.id, message.guild.id].mcash++;
Note: the whole function is not given, this may be only a portion of the solution.