Fix Everything

This commit is contained in:
Daniel Odendahl Jr
2017-06-01 18:31:20 +00:00
parent 66706d9c7b
commit 4e1f83a30f
85 changed files with 721 additions and 851 deletions
+14 -14
View File
@@ -3,21 +3,21 @@ const { DATABASE_URL } = process.env;
const database = new Sequelize(DATABASE_URL, { logging: false });
class Database {
static get db() {
return database;
}
static get db() {
return database;
}
static start() {
database.authenticate()
.then(() => console.log('[DATABASE] Connection has been established successfully.'))
.then(() => console.log('[DATABASE] Synchronizing...'))
.then(() => database.sync()
.then(() => console.log('[DATABASE] Synchronizing complete!'))
.catch(err => console.error(`[DATABASE] Error synchronizing: ${err}`))
)
.then(() => console.log('[DATABASE] Ready!'))
.catch(err => console.error(`[DATABASE] Unable to connect: ${err}`));
}
static start() {
database.authenticate()
.then(() => console.log('[DATABASE] Connection has been established successfully.'))
.then(() => console.log('[DATABASE] Synchronizing...'))
.then(() => database.sync()
.then(() => console.log('[DATABASE] Synchronizing complete!'))
.catch((err) => console.error(`[DATABASE] Error synchronizing: ${err}`))
)
.then(() => console.log('[DATABASE] Ready!'))
.catch((err) => console.error(`[DATABASE] Unable to connect: ${err}`));
}
}
module.exports = Database;
+4 -8
View File
@@ -5,14 +5,10 @@ class Stats {
static dBots(count, id) {
snekfetch
.post(`https://bots.discord.pw/api/bots/${id}/stats`)
.set({
Authorization: DBOTS_KEY
})
.send({
server_count: count
})
.set({ Authorization: DBOTS_KEY })
.send({ server_count: count })
.then(() => console.log('[CARBON] Successfully posted to Carbon.'))
.catch(err => console.error(`[CARBON] Failed to post to Carbon. ${err}`));
.catch((err) => console.error(`[CARBON] Failed to post to Carbon. ${err}`));
}
static carbon(count) {
@@ -23,7 +19,7 @@ class Stats {
servercount: count
})
.then(() => console.log('[DBOTS] Successfully posted to Discord Bots.'))
.catch(err => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`));
.catch((err) => console.error(`[DBOTS] Failed to post to Discord Bots. ${err}`));
}
}