updated start scripts

This commit is contained in:
2022-01-27 20:43:51 -06:00
parent f6adafe735
commit 4f696e8b21
5 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
node_modules node_modules
token token
.DS_Store .DS_Store
log

1
dist/index.js vendored
View File

@@ -34,6 +34,7 @@ const api_1 = require("./api");
const discord_1 = require("./discord"); const discord_1 = require("./discord");
const queue_1 = require("./queue"); const queue_1 = require("./queue");
const CLIENT = new discord_js_1.Client({ intents: [discord_js_1.Intents.FLAGS.GUILDS] }); const CLIENT = new discord_js_1.Client({ intents: [discord_js_1.Intents.FLAGS.GUILDS] });
console.log(new Date().toISOString() + '\n\n');
if (!fs.existsSync('./token')) { if (!fs.existsSync('./token')) {
fs.writeFileSync('./token', ''); fs.writeFileSync('./token', '');
console.error('Missing Discord Token, please enter the bot token into the token file'); console.error('Missing Discord Token, please enter the bot token into the token file');

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/bash
#change to ccurrent directory #change to ccurrent directory
cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" cd -- "$( dirname -- "${BASH_SOURCE[0]}" )"

View File

@@ -32,7 +32,7 @@ do
echo $num > log/number echo $num > log/number
#run #run
npm start >> log/$num.out 2> log/$num.err npm start 2> log/$num.err | tee log/$num.out
#give chance to close program #give chance to close program
sleep 5 sleep 5

View File

@@ -6,6 +6,8 @@ import { registerCommands } from './discord';
import { createQueue, joinQueue, queueInfo } from './queue'; import { createQueue, joinQueue, queueInfo } from './queue';
const CLIENT = new Client({ intents: [Intents.FLAGS.GUILDS] }); const CLIENT = new Client({ intents: [Intents.FLAGS.GUILDS] });
console.log(new Date().toISOString()+'\n\n');
if (!fs.existsSync('./token')) { if (!fs.existsSync('./token')) {
fs.writeFileSync('./token', ''); fs.writeFileSync('./token', '');
console.error('Missing Discord Token, please enter the bot token into the token file'); console.error('Missing Discord Token, please enter the bot token into the token file');