I'm having problems with constants in different files: I have to store an embed in a different file, and then call it in the main one, but when I try to do it gives me parse errors like Unexpected '.' in 'help.embed'
I tried to use the methods suggested in these threads [1,2] but they didn't work: it continues to give me that parse error. Can somebody help me?
PS: I don't want to use an HTML file to call the scripts, I want to use only JS and JSON
This is my code (simplified):
// help.js
const Discord = require("discord.js");
var embed = new Discord.RichEmbed()
.setTitle("Title")
module.exports = Object.freeze({
embed: embed
});
// main.js
const help = require("./help.js")
client.on("ready", () =>{
client.channels.find("id",config.disaply_channel).send(help.embed); //Parse error
});