Skip to content

Commit

Permalink
Discord Economy Super v1.7.5
Browse files Browse the repository at this point in the history
- Fixed JSDoc typos/mismatches.
- Fixed the hard crash in **JSON** version when trying to claim `daily`, `work` or `weekly` rewards.
- Fixed the INVALID_TYPE error when getting the currencies by ID.
- **Updated the documentation** - updated the [FAQ](https://des-docs.js.org/#/docs/main/1.7.5/general/faq), added **shop** examples and more explanations of the code on [Examples](https://des-docs.js.org/#/docs/main/1.7.5/general/examples) page in the documentation + added the [Configuring Economy](https://des-docs.js.org/#/docs/main/1.7.5/general/configuring) page that explains everything about configuring the module and [Custom Item Data](https://des-docs.js.org/#/docs/main/1.7.5/general/custom-data) page explaining the `custom` property  - check them out!
- Minor bug fixes.
- Added an option for `package.json` to disable the post-install greeting logs. To disable them, you need to add this in your `package.json`:
```json
"discord-economy-super": {
    "postinstall": false
}
```
To enable them back, you need to set the `"postinstall"` property of `"discord-economy-super"` object to `true`:
```json
"discord-economy-super": {
    "postinstall": true
}
```
(or simply remove this object from your `package.json`)
  • Loading branch information
shadowplay1 committed Feb 25, 2023
1 parent 21e00e7 commit 27f0762
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion mongodb/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 ShadowPlay.
Copyright (c) 2023 ShadowPlay <shadowplay483@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion mongodb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "discord-economy-super",
"version": "1.7.4",
"version": "1.7.5",
"types": "./typings/Economy.d.ts",
"description": "Easy and customizable economy module for your Discord Bot.",
"main": "index.js",
Expand Down
4 changes: 2 additions & 2 deletions mongodb/typings/classes/InventoryItem.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ declare class InventoryItem<T extends object = any> {
public remove(quantity?: number): Promise<boolean>

/**
* Uses the item from user's inventory.
* @param {Client} [client] Discord Client [Specify if the role will be given in a Discord server].
* Uses the item: returns the item usage message and removes the item from user's inventory.
* @param {Client} [client] Discord Client. [Specify if the role will be given on a Discord server]
* @returns {Promise<string>} Item message.
*/
public use(client?: any): Promise<string>
Expand Down
18 changes: 12 additions & 6 deletions mongodb/typings/classes/user/Balance.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,29 @@ declare class Balance extends Emitter {
public constructor(memberID: string, guildID: string, ecoOptions: EconomyConfiguration, database: DatabaseManager)

/**
* Returns a factory with `get`, `set`, `add` and `subtract` methods to work with custom currencies.
* Returns a factory with `get`, `getCurrency` (to get a currency info object),
* `set`, `add` and `subtract` methods to work with custom currencies.
*
* @param {string} currencyID Currency ID, its name or its symbol.
* @returns {CurrencyFactory} Factory object.
* @returns {CurrencyFactory} Currency management factory object.
*/
public currency(currencyID: string): CurrencyFactory

/**
* Returns a factory with `get`, `set`, `add` and `subtract` methods to work with custom currencies.
* Returns a factory with `get`, `getCurrency` (to get a currency info object),
* `set`, `add` and `subtract` methods to work with custom currencies.
*
* @param {number} currencyID Currency ID, its name or its symbol.
* @returns {CurrencyFactory} Factory object.
* @returns {CurrencyFactory} Currency management factory object.
*/
public currency(currencyID: number): CurrencyFactory

/**
* Returns a factory with `get`, `set`, `add` and `subtract` methods to work with custom currencies.
* Returns a factory with `get`, `getCurrency` (to get a currency info object),
* `set`, `add` and `subtract` methods to work with custom currencies.
*
* @param {string | number} currencyID Currency ID, its name or its symbol.
* @returns {CurrencyFactory} Factory object.
* @returns {CurrencyFactory} Currency management factory object.
*/
public currency(currencyID: string | number): CurrencyFactory

Expand Down
4 changes: 2 additions & 2 deletions mongodb/typings/classes/user/Inventory.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ declare class Inventory extends BaseManager<InventoryItem<any>> {
public all<T extends object = any>(): Promise<InventoryItem<T>[]>

/**
* Uses the item from user's inventory.
* Uses the item: returns the item usage message and removes the item from user's inventory.
* @param {string} itemID Item ID.
* @param {any} [client] Discord Client [Specify if the role will be given in a Discord server].
* @param {any} [client] Discord Client. [Specify if the role will be given on a Discord server]
* @returns {Promise<string>} Item message or null if item not found.
*/
public use(itemID: string | number, client?: any): Promise<string>
Expand Down
4 changes: 2 additions & 2 deletions mongodb/typings/classes/user/Items.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ declare class Items {
public get<T extends object = any>(itemID: string | number): Promise<InventoryItem<T>>

/**
* Uses the item from user's inventory.
* Uses the item: returns the item usage message and removes the item from user's inventory.
* @param {string | number} itemID Item ID or name.
* @param {Client} [client] Discord Client [Specify if the role will be given in a Discord server].
* @param {Client} [client] Discord Client. [Specify if the role will be given on a Discord server]
* @returns {Promise<string>} Item message.
*/
public use(itemID: string | number, client?: any): Promise<string>
Expand Down
3 changes: 1 addition & 2 deletions mongodb/typings/interfaces/EconomyConfiguration.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { MongoConnectionOptions } from 'quick-mongo-super/typings/interfaces/QuickMongo'
import { IMongoConnectionOptions } from 'quick-mongo-super/typings/interfaces/QuickMongo'

import CheckerConfiguration from './CheckerConfiguration'
import ErrorHandlerConfiguration from './ErrorHandlerConfiguration'
import UpdaterOptions from './UpdaterOptions'


/**
* Economy configuration.
*/
Expand Down
18 changes: 12 additions & 6 deletions mongodb/typings/managers/BalanceManager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,35 @@ declare class BalanceManager extends Emitter {
public constructor(options: EconomyConfiguration, database: DatabaseManager, cache: CacheManager)

/**
* Returns a factory with `get`, `set`, `add` and `subtract` methods to work with custom currencies.
* Returns a factory with `get`, `getCurrency` (to get a currency info object),
* `set`, `add` and `subtract` methods to work with custom currencies.
*
* @param {string} currencyID Currency ID, its name or its symbol.
* @param {string} memberID Member ID.
* @param {string} guildID Guild ID.
* @returns {CurrencyFactory} Factory object.
* @returns {CurrencyFactory} Currency management factory object.
*/
public currency(currencyID: string, memberID: string, guildID: string): CurrencyFactory

/**
* Returns a factory with `get`, `set`, `add` and `subtract` methods to work with custom currencies.
* Returns a factory with `get`, `getCurrency` (to get a currency info object),
* `set`, `add` and `subtract` methods to work with custom currencies.
*
* @param {number} currencyID Currency ID, its name or its symbol.
* @param {string} memberID Member ID.
* @param {string} guildID Guild ID.
* @returns {CurrencyFactory} Factory object.
* @returns {CurrencyFactory} Currency management factory object.
*/
public currency(currencyID: number, memberID: string, guildID: string): CurrencyFactory

/**
* Returns a factory with `get`, `set`, `add` and `subtract` methods to work with custom currencies.
* Returns a factory with `get`, `getCurrency` (to get a currency info object),
* `set`, `add` and `subtract` methods to work with custom currencies.
*
* @param {string | number} currencyID Currency ID, its name or its symbol.
* @param {string} memberID Member ID.
* @param {string} guildID Guild ID.
* @returns {CurrencyFactory} Factory object.
* @returns {CurrencyFactory} Currency management factory object.
*/
public currency(currencyID: string | number, memberID: string, guildID: string): CurrencyFactory

Expand Down
4 changes: 2 additions & 2 deletions mongodb/typings/managers/CurrencyManager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ declare class CurrencyManager extends Emitter {
* @param {string} memberID Member ID.
* @param {string} guildID Guild ID.
* @param {string} [reason] The reason why the money was added.
* @returns {Promise<number>} Amount of money that was add.
* @returns {Promise<number>} Amount of money that was added.
*/
public addBalance(currencyID: string, amount: number, memberID: string, guildID: string, reason?: string): Promise<number>

Expand All @@ -256,7 +256,7 @@ declare class CurrencyManager extends Emitter {
* @param {string} memberID Member ID.
* @param {string} guildID Guild ID.
* @param {string} [reason] The reason why the money was subtracted.
* @returns {Promise<number>} Amount of money that was subtract.
* @returns {Promise<number>} Amount of money that was subtracted.
*/
public subtractBalance(currencyID: number, amount: number, memberID: string, guildID: string, reason?: string): Promise<number>

Expand Down
4 changes: 2 additions & 2 deletions mongodb/typings/managers/InventoryManager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ declare class InventoryManager extends Emitter {
public useItem(itemID: string | number, memberID: string, guildID: string, client?: any): Promise<string>

/**
* Uses the item from user's inventory.
* Uses the item: returns the item usage message and removes the item from user's inventory.
*
* This method is an alias for the `InventoryManager.useItem()` method.
* @param {string | number} itemID Item ID or name.
* @param {string} memberID Member ID.
* @param {string} guildID Guild ID.
* @param {Client} [client] The Discord Client. [Optional]
* @param {Client} [client] Discord Client. [Specify if the role will be given on a Discord server]
* @returns {Promise<string>} Item message or null if item not found.
*/
public use(itemID: string | number, memberID: string, guildID: string, client?: any): Promise<string>
Expand Down

0 comments on commit 27f0762

Please sign in to comment.