Compare commits
4 Commits
3182903c77
...
df49abf989
Author | SHA1 | Date |
---|---|---|
Kit Kasune | df49abf989 | 2 years ago |
Kit Kasune | cb0d1d8622 | 2 years ago |
Kit Kasune | c1d40eb1be | 2 years ago |
Kit Kasune | 00af710ebd | 2 years ago |
@ -1,22 +1,23 @@ |
||||
const chalk = require('chalk'); |
||||
const mongoose = require('mongoose'); |
||||
|
||||
const log = require('../util/log/log'); |
||||
const ora = require('../util/log/ora'); |
||||
|
||||
module.exports = async client => { |
||||
const auth = client.auth; |
||||
const t = Date.now(); |
||||
client.misc.dbconnected = false; |
||||
client.misc.dbconnected = true; |
||||
await ora(chalk.blueBright.bold.underline("Connecting to MongoDB..."), |
||||
mongoose.connect(`mongodb+srv://${auth.database.user}:${auth.database.password}@${auth.database.cluster}.3jpp4.mongodb.net/test`, { |
||||
useFindAndModify: false, useNewUrlParser: true, dbName: auth.database.name, useUnifiedTopology: true, useCreateIndex: true |
||||
}) |
||||
).catch((e) => client.error("Failed to connect to mongoose!! Error below.", 0, true, true, e)) |
||||
.then(() => {client.misc.dbconnected = true;}); |
||||
).catch((e) => { |
||||
client.error("Failed to connect to mongoose!! Error below.", 0, 0, true, e); |
||||
client.misc.dbconnected = false; |
||||
}); |
||||
if (!client.misc.dbconnected) { |
||||
client.warn("Database not connected, considering runtime to be unusable and exiting.", 0, true, true); |
||||
throw new Error(); |
||||
} |
||||
return client.success(`Connected to Mongo Database in ${chalk.white(`${Date.now() - t}ms`)}.`); |
||||
return client.success(`Connected to Mongo Database in ${chalk.white(`${Date.now() - t}ms`)}.`, 0, 0, 1); |
||||
}; |
@ -0,0 +1,5 @@ |
||||
const fs = require('fs'); |
||||
|
||||
module.exports = async client => { |
||||
|
||||
}; |
@ -0,0 +1 @@ |
||||
module.exports = async client => {}; |
@ -0,0 +1,8 @@ |
||||
const {Collection} = require("discord.js"); |
||||
|
||||
module.exports = async client => { |
||||
['commands', 'events'].forEach(x => { |
||||
client[x] = new Collection(); |
||||
require(`../collect/${x}`)(client); |
||||
}); |
||||
}; |
@ -0,0 +1,10 @@ |
||||
const moment = require("moment"); |
||||
const chalk = require('chalk'); |
||||
const os = require('os'); |
||||
|
||||
module.exports = client => { |
||||
client.log(`Logged in as ${chalk.blueBright(client.user.username)}. ${chalk.greenBright(`[${chalk.grey(client.user.id)}]`)}`); |
||||
client.log(`Time: ${chalk.blueBright(moment().format('MMMM d, YYYY - HH:MM:SS'))}`); |
||||
client.log(`Running on ${chalk.blueBright(client.guilds.cache.size)} ${chalk.blue("servers")} and interacting with about ${chalk.blueBright(client.users.cache.size)} ${chalk.blue("users")}.`); |
||||
client.log(`This ${chalk.blue('heap')} has ${chalk.blueBright((process.memoryUsage().heapTotal / (1024 ** 2)).toFixed(2))}MB allocated; The ${chalk.blue('machine')} has ${chalk.blueBright((os.totalmem() / (1024 ** 3)).toFixed(2))}GB (${chalk.blueBright((os.freemem() / (1024 ** 3)).toFixed(2))}GB free)`); |
||||
}; |
@ -0,0 +1,8 @@ |
||||
const chalk = require('chalk'); |
||||
|
||||
module.exports = e => { |
||||
console.log(`#######################################\n\n${chalk.grey('[NATS]')} >> ${chalk.hex('#78d9f8')("Well this is awkward.")}\n`); |
||||
console.log(`${chalk.bold.redBright.underline("There was an error that killed Natsuki's process.")}\n${chalk.redBright("See available stack trace and error information below.")}\n`); |
||||
console.error(e); |
||||
console.log(`\n#######################################\n\n${chalk.grey('[NATS]')} >> ${chalk.hex('#78d9f8')("Back to sleepies...")}`); |
||||
}; |
Loading…
Reference in new issue