diff --git a/src/class/Client.ts b/src/class/Client.ts index d117ff0..5753a09 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -46,7 +46,7 @@ export default class Client extends eris.Client { await (new this.db.Stat({ name: 'pages', value: 0 }).save()); } if (!statRequests) { - await (new this.db.Stat({ name: 'requests' }).save()); + await (new this.db.Stat({ name: 'requests', value: 0 }).save()); } } diff --git a/src/class/Route.ts b/src/class/Route.ts index 97a24d0..0d90eaa 100644 --- a/src/class/Route.ts +++ b/src/class/Route.ts @@ -20,7 +20,7 @@ export default class Route { public init() { this.router.all('*', (req, res, next) => { this.server.client.util.signale.log(`'${req.method}' request from '${req.ip}' to '${req.hostname}${req.path}'.`); - this.server.client.db.Stat.updateOne({ name: 'requests' }, { $inc: { value: 1 } }); + this.server.client.db.Stat.updateOne({ name: 'requests' }, { $inc: { value: 1 } }).exec(); if (this.conf.maintenance === true) res.status(503).json({ code: this.constants.codes.MAINTENANCE_OR_UNAVAILABLE, message: this.constants.messages.MAINTENANCE_OR_UNAVAILABLE }); else if (this.conf.deprecated === true) res.status(501).json({ code: this.constants.codes.DEPRECATED, message: this.constants.messages.DEPRECATED }); else next(); diff --git a/src/commands/index.ts b/src/commands/index.ts index 614abd0..3b77616 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -19,6 +19,7 @@ export { default as page } from './page'; export { default as ping } from './ping'; export { default as rank } from './rank'; export { default as roleinfo } from './roleinfo'; +export { default as stats } from './stats'; export { default as storemessages } from './storemessages'; export { default as unban } from './unban'; export { default as unmute } from './unmute'; diff --git a/src/commands/page.ts b/src/commands/page.ts index 1f5e398..dd60b54 100644 --- a/src/commands/page.ts +++ b/src/commands/page.ts @@ -146,7 +146,7 @@ export default class Page extends Command { html: `