added comments

This commit is contained in:
2022-01-31 14:24:29 -06:00
parent a3a7acf9a8
commit 5167a25626
3 changed files with 9 additions and 1 deletions

View File

@@ -6,8 +6,10 @@ import { registerCommands } from './discord';
import { createQueue, joinQueue, leaveQueue, queueInfo, readyQueue } from './queue';
const CLIENT = new Client({ intents: [Intents.FLAGS.GUILDS] });
//init logs with a timestamp
console.log(new Date().toISOString()+'\n\n');
//get token
if (!fs.existsSync('./token')) {
fs.writeFileSync('./token', '');
console.error('Missing Discord Token, please enter the bot token into the token file');
@@ -15,6 +17,7 @@ if (!fs.existsSync('./token')) {
}
const TOKEN = fs.readFileSync('./token').toString();
//discord connections
CLIENT.on('ready', client => {
console.log(`Logged in as ${client.user.tag}`);
client.guilds.fetch().then(guilds =>