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 +33 -29
- package/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/lib/structures/items/BaseItem.js +2 -0
package/README.md
CHANGED
|
@@ -132,38 +132,42 @@ Returns: `Promise<any>`
|
|
|
132
132
|
|
|
133
133
|
#### StoreItem
|
|
134
134
|
|
|
135
|
-
| Type | Property
|
|
136
|
-
|
|
137
|
-
| String | `id`
|
|
138
|
-
| String | `name`
|
|
139
|
-
| String | `description?`
|
|
140
|
-
| Number | `price`
|
|
141
|
-
| Number | `stockRemaining`
|
|
142
|
-
| Boolean | `unlimitedStock`
|
|
143
|
-
| Number | `maxQuantity?`
|
|
144
|
-
| Boolean | `isInventory`
|
|
145
|
-
| Date | `expiresAt?`
|
|
146
|
-
| Boolean | `isUsable`
|
|
147
|
-
| Boolean | `isSellable`
|
|
148
|
-
|
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
|
|
|
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
|
|
156
|
-
|
|
157
|
-
| String | `itemId`
|
|
158
|
-
| Number | `quantity`
|
|
159
|
-
| String | `name`
|
|
160
|
-
| String | `description?`
|
|
161
|
-
| Boolean | `isUsable`
|
|
162
|
-
| Boolean | `isSellable`
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
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
|
@@ -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;
|