diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2aca768..945ea5a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,5 @@ jobs: cd Kami rm package-lock.json git pull - npm prune npm install - npm audit fix --force - pm2 reload bot + pm2 restart bot diff --git a/package.json b/package.json index c090757..0a66e23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "kami", - "version": "4.13.4", + "version": "4.13.5", "description": "Um BOT para Discord com foco em ajudar em mesas de RPG online, tendo suas principais funções criar fichas e rolar dados.", "main": "index.js", "scripts": { diff --git a/src/resources/config/cache.js b/src/resources/config/cache.js index 68dc597..90bbb8b 100644 --- a/src/resources/config/cache.js +++ b/src/resources/config/cache.js @@ -13,8 +13,6 @@ function replaceAll(string, search, replace) { return splited } -const commandCount = new Object() - // module.exports = class Cache { // constructor(client) { // this.client = client @@ -527,6 +525,11 @@ const commandCount = new Object() // } +const commandCount = new Object({ + cmd: 0, + buttons: 0, +}) + module.exports = class DirectDB { constructor(client) { this.client = client; @@ -556,9 +559,9 @@ module.exports = class DirectDB { const result = await this.client.db.query("select commandcount, buttoncount from info"); return { total: result[0][0].commandcount, - today: 0, + today: commandCount.cmd, buttonsTotal: result[0][0].buttoncount, - buttonsToday: 0, + buttonsToday: commandCount.buttons, }; } @@ -625,8 +628,10 @@ module.exports = class DirectDB { async updateCnt(type) { if (type === "cmd") { + commandCount.cmd = commandCount.cmd + 1; await this.client.db.query("update info set commandcount = commandcount + 1"); } else if (type === "button") { + commandCount.buttons = commandCount.buttons + 1; await this.client.db.query("update info set buttoncount = buttoncount + 1"); } }