unb-api 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -132,38 +132,42 @@ Returns: `Promise<any>`
132
132
 
133
133
  #### StoreItem
134
134
 
135
- | Type | Property | Description |
136
- |---------|------------------|---------------------------------------------------------------------------|
137
- | String | `id` | Unique ID of the item in the store. |
138
- | String | `name` | Name of the item. |
139
- | String | `description?` | Description of the item. |
140
- | Number | `price` | Price of the item. |
141
- | Number | `stockRemaining` | Amount of stock remaining for the item. |
142
- | Boolean | `unlimitedStock` | Whether the item has unlimited stock. |
143
- | Number | `maxQuantity?` | Max a user can own, or buy at once if not an inventory item. |
144
- | Boolean | `isInventory` | Indicates if the item will be added to a user’s inventory when purchased. |
145
- | Date | `expiresAt?` | Expiration date of the item. |
146
- | Boolean | `isUsable` | Whether the item can be used by the user. |
147
- | Boolean | `isSellable` | Whether the item can be sold by the user. |
148
- | Array | `requirements` | Requirements needed to purchase the item. |
149
- | Array | `actions` | Actions performed when the item is used. |
150
- | String | `emojiUnicode?` | Unicode emoji associated with the item. |
151
- | String | `emojiId?` | Custom emoji ID associated with the item. |
135
+ | Type | Property | Description |
136
+ |---------|-----------------------|---------------------------------------------------------------------------|
137
+ | String | `id` | Unique ID of the item in the store. |
138
+ | String | `name` | Name of the item. |
139
+ | String | `description?` | Description of the item. |
140
+ | Number | `price` | Price of the item. |
141
+ | Number | `stockRemaining` | Amount of stock remaining for the item. |
142
+ | Boolean | `unlimitedStock` | Whether the item has unlimited stock. |
143
+ | Number | `maxQuantity?` | Max a user can own, or buy at once if not an inventory item. |
144
+ | Boolean | `isInventory` | Indicates if the item will be added to a user’s inventory when purchased. |
145
+ | Date | `expiresAt?` | Expiration date of the item. |
146
+ | Boolean | `isUsable` | Whether the item can be used by the user. |
147
+ | Boolean | `isSellable` | Whether the item can be sold by the user. |
148
+ | Boolean | `isReusable` | Whether the item stays in the inventory when used. |
149
+ | Number | `useCooldownSeconds?` | Seconds a user must wait between uses of the item. |
150
+ | Array | `requirements` | Requirements needed to purchase the item. |
151
+ | Array | `actions` | Actions performed when the item is used. |
152
+ | String | `emojiUnicode?` | Unicode emoji associated with the item. |
153
+ | String | `emojiId?` | Custom emoji ID associated with the item. |
152
154
 
153
155
  #### InventoryItem
154
156
 
155
- | Type | Property | Description |
156
- |-------------------------------------------------|-----------------|-----------------------------------------------|
157
- | String | `itemId` | Unique ID of the item in the inventory. |
158
- | Number | `quantity` | Quantity of the item in the user's inventory. |
159
- | String | `name` | Name of the item. |
160
- | String | `description?` | Description of the item. |
161
- | Boolean | `isUsable` | Whether the item can be used by the user. |
162
- | Boolean | `isSellable` | Whether the item can be sold by the user. |
163
- | [StoreItemRequirement[]](#StoreItemRequirement) | `requirements` | Requirements needed to use the item. |
164
- | [StoreItemAction[]](#StoreItemAction) | `actions` | Actions performed when the item is used. |
165
- | String | `emojiUnicode?` | Unicode emoji associated with the item. |
166
- | String | `emojiId?` | Custom emoji ID associated with the item. |
157
+ | Type | Property | Description |
158
+ |-------------------------------------------------|-----------------------|----------------------------------------------------|
159
+ | String | `itemId` | Unique ID of the item in the inventory. |
160
+ | Number | `quantity` | Quantity of the item in the user's inventory. |
161
+ | String | `name` | Name of the item. |
162
+ | String | `description?` | Description of the item. |
163
+ | Boolean | `isUsable` | Whether the item can be used by the user. |
164
+ | Boolean | `isSellable` | Whether the item can be sold by the user. |
165
+ | Boolean | `isReusable` | Whether the item stays in the inventory when used. |
166
+ | Number | `useCooldownSeconds?` | Seconds a user must wait between uses of the item. |
167
+ | [StoreItemRequirement[]](#StoreItemRequirement) | `requirements` | Requirements needed to use the item. |
168
+ | [StoreItemAction[]](#StoreItemAction) | `actions` | Actions performed when the item is used. |
169
+ | String | `emojiUnicode?` | Unicode emoji associated with the item. |
170
+ | String | `emojiId?` | Custom emoji ID associated with the item. |
167
171
 
168
172
  #### StoreItemRequirement
169
173
 
package/index.d.ts CHANGED
@@ -98,6 +98,8 @@ declare module 'unb-api' {
98
98
  public description?: string;
99
99
  public isUsable: boolean;
100
100
  public isSellable: boolean;
101
+ public isReusable: boolean;
102
+ public useCooldownSeconds: number | null;
101
103
  public requirements: StoreItemRequirement[];
102
104
  public actions: StoreItemAction[];
103
105
  public emojiUnicode?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unb-api",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "API wrapper for UnbelievaBoat Discord Bot API",
5
5
  "main": "src/index.js",
6
6
  "types": "index.d.ts",
@@ -7,6 +7,8 @@ class BaseItem {
7
7
  this.description = data.description;
8
8
  this.isUsable = data.is_usable;
9
9
  this.isSellable = data.is_sellable;
10
+ this.isReusable = data.is_reusable ?? false;
11
+ this.useCooldownSeconds = data.use_cooldown_seconds ?? null;
10
12
  this.requirements = data.requirements.map(requirement => new StoreItemRequirement(requirement));
11
13
  this.actions = data.actions.map(action => new StoreItemAction(action));
12
14
  this.emojiUnicode = data.emoji_unicode;