-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed bugs. - Fixed typings bugs. - Bank balance caching! - Fixed the hard crash in MongoDB version when trying to obtain a balance data for the user from the cache. - Added an `updateMany` alias for `updateSpecified` method in `CacheManager`.
- Loading branch information
1 parent
0d6be3b
commit d3f0498
Showing
8 changed files
with
114 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const DatabaseManager = require('../managers/DatabaseManager') | ||
|
||
/** | ||
* Bank balance item class. | ||
*/ | ||
class BankBalanceItem { | ||
|
||
/** | ||
* User bank balance class. | ||
* @param {string} memberID Member ID. | ||
* @param {string} guildID Guild ID. | ||
* @param {EconomyOptions} ecoOptions Economy configuration. | ||
* @param {BalanceObject} bankBalanceObject User bank balance object. | ||
* @param {DatabaseManager} database Database manager. | ||
*/ | ||
constructor(memberID, guildID, ecoOptions, bankBalanceObject, database) { | ||
|
||
/** | ||
* Member ID. | ||
* @type {string} | ||
*/ | ||
this.memberID = memberID | ||
|
||
/** | ||
* Guild ID. | ||
* @type {string} | ||
*/ | ||
this.guildID = guildID | ||
|
||
/** | ||
* User bank balance object. | ||
* @type {number} | ||
*/ | ||
this.balance = bankBalanceObject.balance | ||
} | ||
} | ||
|
||
|
||
/** | ||
* Bank balance object. | ||
* @typedef {Object} BankBalanceObject | ||
* @property {number} balance User's bank balance. | ||
*/ | ||
|
||
module.exports = BankBalanceItem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters