I am really stuck, and I need help answering how to generate new random strings from my bot, so far this is the code when a user type %random
// Dependencies
const { MessageEmbed, Message } = require('discord.js');
const config = require('../config.json');
module.exports = {
name: 'random', // Command name
description: 'Generate a random alphanumeric string.', // Command description
/**
* Command exetute
* @param {Message} message The message sent by user
*/
execute(message) {
if (message.channel.id !== config.stringChannel) {
message.channel.send(
new MessageEmbed()
.setColor(config.color.default)
.setTitle('Wrong Channel')
.setDescription('Go to '+`<#${config.stringChannel}>`+' to generate nitro') // Mapping the commands
.setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, size: 64 }))
.setTimestamp()
);
};
const gn = [`${Math.random().toString(36).slice(2)}`+'\n'];
if (message.channel.id === config.stringChannel) {
message.channel.send(
new MessageEmbed()
.setColor(config.color.default)
.setTitle(`String Generated`)
.setDescription(`${gn}${gn}`) // Mapping the commands
.setFooter(message.author.tag, message.author.displayAvatarURL({ dynamic: true, size: 64 }))
.setTimestamp()
);
}
}
};
The following picture is the resulting embedded message I receive when I send %random received embed

