gambling-bot-shared 0.1.30 → 0.1.32
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/dist/constants/defaultConfig.d.ts +2 -0
- package/dist/constants/defaultConfig.js +9 -7
- package/dist/mongoose/guildConfiguration.schema.d.ts +2 -0
- package/dist/mongoose/transaction.schema.js +9 -3
- package/dist/mongoose/user.schema.d.ts +9 -0
- package/dist/mongoose/user.schema.js +4 -3
- package/dist/types/user.d.ts +1 -0
- package/package.json +5 -3
|
@@ -99,13 +99,15 @@ exports.defaultCasinoSettings = {
|
|
|
99
99
|
},
|
|
100
100
|
plinko: {
|
|
101
101
|
binMultipliers: {
|
|
102
|
-
0:
|
|
103
|
-
1:
|
|
104
|
-
2:
|
|
105
|
-
3: 0.
|
|
106
|
-
4: 0.
|
|
107
|
-
5:
|
|
108
|
-
6:
|
|
102
|
+
0: 8,
|
|
103
|
+
1: 6,
|
|
104
|
+
2: 1.5,
|
|
105
|
+
3: 0.75,
|
|
106
|
+
4: 0.5,
|
|
107
|
+
5: 0.75,
|
|
108
|
+
6: 1.5,
|
|
109
|
+
7: 6,
|
|
110
|
+
8: 8
|
|
109
111
|
},
|
|
110
112
|
maxBet: 0,
|
|
111
113
|
minBet: 0
|
|
@@ -9,17 +9,23 @@ exports.TransactionSchema = new mongoose_1.Schema({
|
|
|
9
9
|
type: {
|
|
10
10
|
type: String,
|
|
11
11
|
required: true,
|
|
12
|
-
enum: ['deposit', 'withdraw', 'bet', 'win', 'refund', 'bonus', 'vip']
|
|
12
|
+
enum: ['deposit', 'withdraw', 'bet', 'win', 'refund', 'bonus', 'vip']
|
|
13
13
|
},
|
|
14
14
|
source: {
|
|
15
15
|
type: String,
|
|
16
16
|
required: true,
|
|
17
|
-
enum: ['command', 'manual', 'web', 'system', 'casino']
|
|
17
|
+
enum: ['command', 'manual', 'web', 'system', 'casino']
|
|
18
18
|
},
|
|
19
19
|
meta: { type: mongoose_1.Schema.Types.Mixed, default: {} },
|
|
20
20
|
betId: { type: String, default: null },
|
|
21
|
-
handledBy: { type: String, default: null }
|
|
21
|
+
handledBy: { type: String, default: null }
|
|
22
22
|
}, { timestamps: { createdAt: true, updatedAt: false } });
|
|
23
|
+
exports.TransactionSchema.index({ betId: 1, type: 1 }, {
|
|
24
|
+
unique: true,
|
|
25
|
+
partialFilterExpression: {
|
|
26
|
+
betId: { $exists: true, $ne: null }
|
|
27
|
+
}
|
|
28
|
+
});
|
|
23
29
|
// for pagination / sorting
|
|
24
30
|
exports.TransactionSchema.index({ guildId: 1, createdAt: -1 });
|
|
25
31
|
// filter + sort
|
|
@@ -46,6 +46,15 @@ export declare const UserSchema: Schema<TUser, import("mongoose").Model<TUser, a
|
|
|
46
46
|
}, "id"> & {
|
|
47
47
|
id: string;
|
|
48
48
|
}> | undefined;
|
|
49
|
+
bonusBalance?: import("mongoose").SchemaDefinitionProperty<number, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TUser & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
49
58
|
lockedBalance?: import("mongoose").SchemaDefinitionProperty<number, TUser, import("mongoose").Document<unknown, {}, TUser, {
|
|
50
59
|
id: string;
|
|
51
60
|
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TUser & {
|
|
@@ -5,9 +5,10 @@ const mongoose_1 = require("mongoose");
|
|
|
5
5
|
exports.UserSchema = new mongoose_1.Schema({
|
|
6
6
|
userId: { type: String, required: true },
|
|
7
7
|
guildId: { type: String, required: true },
|
|
8
|
-
balance: { type: Number, default: 0 },
|
|
9
|
-
|
|
8
|
+
balance: { type: Number, default: 0 }, // CASH (withdrawable)
|
|
9
|
+
bonusBalance: { type: Number, default: 0 }, // BONUS (non-withdrawable)
|
|
10
|
+
lockedBalance: { type: Number, default: 0 }, // ONLY for in-flight bets
|
|
10
11
|
lastDailyClaim: { type: Date, default: null },
|
|
11
|
-
dailyStreak: { type: Number, default: 0 }
|
|
12
|
+
dailyStreak: { type: Number, default: 0 }
|
|
12
13
|
}, { timestamps: true });
|
|
13
14
|
exports.UserSchema.index({ userId: 1, guildId: 1 }, { unique: true });
|
package/dist/types/user.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gambling-bot-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.32",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"type": "
|
|
7
|
+
"type": "module",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
@@ -23,9 +23,11 @@
|
|
|
23
23
|
"release": "pnpm build && npm version patch && npm publish"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"mongoose": "^9.0.0"
|
|
26
|
+
"mongoose": "^9.0.0",
|
|
27
|
+
"discord.js": "^14.25.1"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
30
|
+
"discord.js": "^14.25.1",
|
|
29
31
|
"mongoose": "^9.1.4",
|
|
30
32
|
"typescript": "^5.9.3"
|
|
31
33
|
},
|