From 5f06a6c63e45242258d8d144da332c5f18fbc04c Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Sat, 16 Jan 2021 17:24:41 -0700 Subject: [PATCH] startup timers --- .idea/Natsuki.iml | 1 + .idea/jsLibraryMappings.xml | 6 +++ .idea/modules.xml | 1 + .idea/vcs.xml | 6 +++ .idea/workspace.xml | 75 +++++++++++++++++++++++++++++++++++++ bot.js | 16 +++++--- events/ready.js | 3 ++ 7 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 .idea/jsLibraryMappings.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/Natsuki.iml b/.idea/Natsuki.iml index 24643cc..7b02055 100644 --- a/.idea/Natsuki.iml +++ b/.idea/Natsuki.iml @@ -8,5 +8,6 @@ + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..63326a8 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml index c4ee72c..91e0157 100644 --- a/.idea/modules.xml +++ b/.idea/modules.xml @@ -3,6 +3,7 @@ + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9661ac7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..36bec3b --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1610796005269 + + + + + + \ No newline at end of file diff --git a/bot.js b/bot.js index 66d88ae..095b749 100644 --- a/bot.js +++ b/bot.js @@ -1,5 +1,14 @@ const Discord = require('discord.js'); const client = new Discord.Client(); + +client.misc = { + savers: ['497598953206841375'], + activeDMs: new Discord.Collection(), + statusPings: new Discord.Collection(), + startup: new Date(), + startupNoConnect: null +}; + //const config = require('./config.js'); const auth = require('./auth.json'); @@ -7,6 +16,7 @@ const auth = require('./auth.json'); async function init() { await client.login(auth.token); + client.misc.startupNoConnect = new Date(); client.config = auth; ['commands', 'aliases'].forEach(x => client[x] = new Discord.Collection()); @@ -14,12 +24,6 @@ async function init() { ['command', 'event', 'response'].forEach(x => require(`./handle/${x}`)(client)); client.developers = ["330547934951112705", "673477059904929802"]; - - client.misc = { - savers: ['497598953206841375'], - activeDMs: new Discord.Collection(), - statusPings: new Discord.Collection() - }; client.utils = {}; client.utils.logch = async () => {return client.guilds.cache.get('762707532417335296').channels.cache.get('762732961753595915');}; diff --git a/events/ready.js b/events/ready.js index ea9502d..7c33d8f 100644 --- a/events/ready.js +++ b/events/ready.js @@ -90,5 +90,8 @@ module.exports = async client => { console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`This is restart #${botData.restarts}.`)}`); + let cms = new Date().getTime(); + console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`Startup completed in ${cms - client.misc.startup.getTime()}ms (${cms - client.misc.startupNoConnect.getTime()}ms post-connect).`)}`); + await botData.save(); }; \ No newline at end of file