coding-buddies-discord / cb-bots

4 stars 3 forks source link

refactor !points command #81

Closed cubiquitous closed 1 year ago

cubiquitous commented 1 year ago

this PR has a major rewrite of many DB call methods. As for right now the methods are not well documented and there is lots of code that may seem repetitive. I will create a new PR focused on solving both of those problems. Originally I was going to write in this PR, but since this PR is already very big, I decided that is better to put in a different PR;

the main changes are:

the move of work to the DB should improve speed considerably, specially the larger the data, which happens every time anyone gives a point or enters the group. the sharing of a single pueteer instance will make the command faster, since the instantiation at each call was the main culprit of making it slow.

the command itself is faster now, however, there is something that is making it slower in the very first call that is neither related to the DB calls related to the DB nor to pupeteer. I'll investigated this later and create a different PR for that issue;

closes #74 #71 #68 #67