So I took the information from my last post and yet another issue. Here is server.js
:
// server.js
// where your node app starts
// init project
const express = require('express');
const app = express();
module.exports = app;
which I think I messed up on, not knowing how to export modules and run my bot 24/7.
Here is index.js
:
const Discord = require('discord.js');
const client = new Discord.Client();
const app = require('./server.js');
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('');
I do have the actual token in index.js
.