I've already tried using the ' node index.js ' and ' node index ' commands, but I receive a syntax error message every time.
Here's what my .js file looks like. I'm using Visual Studio Code.
const Discord = require("discord.js");
const TOKEN = "MYTOKENHERE";
var Discord = require("discord.js");
var schedule = require('node-schedule');
var bot = new Discord.Client();
bot.on("message", function(message) {
var channel = bot.channels.find("name", "general");
channel.sendMessage("Hello Owner Just Restarted Me!");
var rule = new schedule.RecurrenceRule();
rule.minute = 0;
rule.hour = [14, 19, 20];
var j = schedule.scheduleJob(rule, function() {
bot.channels.get("id", channel).sendMessage("Testing");
})
console.log("Bot is ready.");
});
bot.login(TOKEN);
The error is:
SyntaxError: Identifier 'Discord' has already been declared.
Discord
twice, by the way – Sterling ArcherDiscord
– Mike Tungvar Discord =
on line 5. – Nate Barbettini