I have no idea what I'm doing.
I have no idea what I'm doinnnn
This commit is contained in:
parent
5a4cfd0a5f
commit
517d9e7383
1 changed files with 63 additions and 50 deletions
21
server.js
21
server.js
|
@ -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();
|
||||
}
|
||||
|
@ -16,10 +17,11 @@ async function checkAndConvertJSONToSQL(){
|
|||
process.stdout.write(false + "\n")
|
||||
}
|
||||
}
|
||||
const createTimerTables = require('./server/createDatabaseTables/createTimersTable');
|
||||
const createLastfmTable = require('./server/createDatabaseTables/createLastfmTable');
|
||||
createLastfmTable();
|
||||
checkAndConvertJSONToSQL();
|
||||
|
||||
|
||||
|
||||
|
||||
async function main(){
|
||||
const { Collection, Client, GatewayIntentBits, Partials } = require('discord.js');
|
||||
const client = new Client({ intents: [GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildMessages,
|
||||
|
@ -70,3 +72,14 @@ client.on('messageCreate', async message => {
|
|||
|
||||
|
||||
client.login(token);
|
||||
|
||||
}
|
||||
|
||||
async function prepareBot(){
|
||||
const createLastfmTable = require('./server/createDatabaseTables/createLastfmTable');
|
||||
await createLastfmTable();
|
||||
await checkAndConvertJSONToSQL();
|
||||
main();
|
||||
}
|
||||
|
||||
prepareBot();
|
||||
|
|
Loading…
Add table
Reference in a new issue