I have no idea what I'm doing.
All checks were successful
CI / CI (push) Successful in 16s
Lint Codebase / eslint (push) Successful in 12s

I have no idea what I'm doinnnn
This commit is contained in:
SileNce5k 2024-11-06 04:06:34 +01:00
parent 5a4cfd0a5f
commit 5850d9cde6
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -1,6 +1,7 @@
const fs = require('fs');
const createInitialConfig = require("./util/createInitialConfig")
const convertTimerJSONToSQL = require('./util/timer/convertTimerJSONToSQL.js');
const createTimerTables = require('./server/createDatabaseTables/createTimersTable');
if(!fs.existsSync("./data/config.json")) {
createInitialConfig();
}
@ -8,7 +9,6 @@ async function checkAndConvertJSONToSQL(){
process.stdout.write("Checking if timers.json exists... ")
if(fs.existsSync("./data/timers.json")){
process.stdout.write(true + "\n")
await createTimerTables();
await convertTimerJSONToSQL();
fs.renameSync('data/timers.json', 'data/timers.json.old');
console.log("Renamed timers.json to timers.json.old");
@ -16,10 +16,10 @@ async function checkAndConvertJSONToSQL(){
process.stdout.write(false + "\n")
}
}
const createTimerTables = require('./server/createDatabaseTables/createTimersTable');
const createLastfmTable = require('./server/createDatabaseTables/createLastfmTable');
createLastfmTable();
checkAndConvertJSONToSQL();
function main(){
const { Collection, Client, GatewayIntentBits, Partials } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
@ -70,3 +70,16 @@ client.on('messageCreate', async message => {
client.login(token);
}
async function prepareBot(){
const createLastfmTable = require('./server/createDatabaseTables/createLastfmTable');
await createTimerTables();
await checkAndConvertJSONToSQL();
await createLastfmTable();
}
prepareBot().then( () => {
main();
});