gambling-bot-shared 0.1.51 → 0.1.53
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 +11 -1
- package/dist/constants/blackjack.d.ts +41 -0
- package/dist/constants/blackjack.js +19 -0
- package/dist/constants/defaultConfig.d.ts +10 -0
- package/dist/constants/defaultConfig.js +24 -2
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -0
- package/dist/constants/plinkoConfig.js +4 -1
- package/dist/constants/rouletteConfig.js +1 -1
- package/dist/mongoose/atmRequest.schema.d.ts +139 -0
- package/dist/mongoose/atmRequest.schema.js +23 -0
- package/dist/mongoose/blackjackGame.schema.d.ts +139 -0
- package/dist/mongoose/blackjackGame.schema.js +34 -0
- package/dist/mongoose/guildConfiguration.schema.d.ts +19 -0
- package/dist/mongoose/guildConfiguration.schema.js +4 -0
- package/dist/mongoose/index.d.ts +3 -0
- package/dist/mongoose/index.js +3 -0
- package/dist/mongoose/prediction.schema.js +12 -12
- package/dist/mongoose/raffle.schema.d.ts +151 -0
- package/dist/mongoose/raffle.schema.js +29 -0
- package/dist/mongoose/transaction.schema.d.ts +1 -1
- package/dist/mongoose/vipRoom.schema.js +2 -2
- package/dist/schemas/forms.d.ts +12 -0
- package/dist/schemas/forms.js +23 -15
- package/dist/types/atmRequest.d.ts +15 -0
- package/dist/types/atmRequest.js +2 -0
- package/dist/types/blackjackGame.d.ts +30 -0
- package/dist/types/blackjackGame.js +2 -0
- package/dist/types/guildConfiguration.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.js +3 -0
- package/dist/types/raffle.d.ts +19 -0
- package/dist/types/raffle.js +2 -0
- package/dist/types/transaction.d.ts +1 -1
- package/dist/utils/calculateBonusReward.js +1 -2
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/normalizeCasinoSettings.d.ts +2 -0
- package/dist/utils/normalizeCasinoSettings.js +33 -0
- package/dist/utils/normalizeGlobalSettings.js +1 -2
- package/dist/utils/winAnnouncements.d.ts +4 -0
- package/dist/utils/winAnnouncements.js +10 -0
- package/package.json +20 -5
package/README.MD
CHANGED
|
@@ -34,4 +34,14 @@ in the case study linked above.
|
|
|
34
34
|
|
|
35
35
|
## Local development
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Bootstrap all three repos in one step:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
curl -fsSL https://raw.githubusercontent.com/krouskystepan/gambling-bot-shared/main/scripts/setup-workspace.sh | bash
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
See [docs/LOCAL_DEVELOPMENT.md](./docs/LOCAL_DEVELOPMENT.md) for the local linking workflow, debugging commands, and CI release process.
|
|
44
|
+
|
|
45
|
+
## GitHub / CI
|
|
46
|
+
|
|
47
|
+
See [docs/GITHUB_SETUP.md](./docs/GITHUB_SETUP.md) for CI workflows and branch protection on `main`.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const SUITES: readonly ["♠️", "♣️", "♥️", "♦️"];
|
|
2
|
+
export declare const VALUES: readonly [{
|
|
3
|
+
readonly label: "A";
|
|
4
|
+
readonly value: 11;
|
|
5
|
+
}, {
|
|
6
|
+
readonly label: "2";
|
|
7
|
+
readonly value: 2;
|
|
8
|
+
}, {
|
|
9
|
+
readonly label: "3";
|
|
10
|
+
readonly value: 3;
|
|
11
|
+
}, {
|
|
12
|
+
readonly label: "4";
|
|
13
|
+
readonly value: 4;
|
|
14
|
+
}, {
|
|
15
|
+
readonly label: "5";
|
|
16
|
+
readonly value: 5;
|
|
17
|
+
}, {
|
|
18
|
+
readonly label: "6";
|
|
19
|
+
readonly value: 6;
|
|
20
|
+
}, {
|
|
21
|
+
readonly label: "7";
|
|
22
|
+
readonly value: 7;
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "8";
|
|
25
|
+
readonly value: 8;
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "9";
|
|
28
|
+
readonly value: 9;
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "10";
|
|
31
|
+
readonly value: 10;
|
|
32
|
+
}, {
|
|
33
|
+
readonly label: "J";
|
|
34
|
+
readonly value: 10;
|
|
35
|
+
}, {
|
|
36
|
+
readonly label: "Q";
|
|
37
|
+
readonly value: 10;
|
|
38
|
+
}, {
|
|
39
|
+
readonly label: "K";
|
|
40
|
+
readonly value: 10;
|
|
41
|
+
}];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VALUES = exports.SUITES = void 0;
|
|
4
|
+
exports.SUITES = ['♠️', '♣️', '♥️', '♦️'];
|
|
5
|
+
exports.VALUES = [
|
|
6
|
+
{ label: 'A', value: 11 },
|
|
7
|
+
{ label: '2', value: 2 },
|
|
8
|
+
{ label: '3', value: 3 },
|
|
9
|
+
{ label: '4', value: 4 },
|
|
10
|
+
{ label: '5', value: 5 },
|
|
11
|
+
{ label: '6', value: 6 },
|
|
12
|
+
{ label: '7', value: 7 },
|
|
13
|
+
{ label: '8', value: 8 },
|
|
14
|
+
{ label: '9', value: 9 },
|
|
15
|
+
{ label: '10', value: 10 },
|
|
16
|
+
{ label: 'J', value: 10 },
|
|
17
|
+
{ label: 'Q', value: 10 },
|
|
18
|
+
{ label: 'K', value: 10 }
|
|
19
|
+
];
|
|
@@ -95,4 +95,14 @@ export declare const defaultCasinoSettings: {
|
|
|
95
95
|
maxBet: number;
|
|
96
96
|
minBet: number;
|
|
97
97
|
};
|
|
98
|
+
winAnnouncements: {
|
|
99
|
+
plinkoMinMultiplier: number;
|
|
100
|
+
goldenJackpotMinMultiplier: number;
|
|
101
|
+
slotsMinMultiplier: number;
|
|
102
|
+
lotteryMinMultiplier: number;
|
|
103
|
+
rouletteMinMultiplier: number;
|
|
104
|
+
blackjackMinMultiplier: number;
|
|
105
|
+
diceMinMultiplier: number;
|
|
106
|
+
coinflipMinMultiplier: number;
|
|
107
|
+
};
|
|
98
108
|
};
|
|
@@ -8,7 +8,18 @@ exports.readableGameValueNames = [
|
|
|
8
8
|
{ name: 'Win Multipliers (x)', value: 'winMultipliers' },
|
|
9
9
|
{ name: 'Casino House Cut (%)', value: 'casinoCut' },
|
|
10
10
|
{ name: 'One-In Chance (e.g. 1 in 10,000)', value: 'oneInChance' },
|
|
11
|
-
{ name: 'Symbol Weights', value: 'symbolWeights' }
|
|
11
|
+
{ name: 'Symbol Weights', value: 'symbolWeights' },
|
|
12
|
+
{ name: 'Plinko Minimum Multiplier', value: 'plinkoMinMultiplier' },
|
|
13
|
+
{
|
|
14
|
+
name: 'Golden Jackpot Minimum Multiplier',
|
|
15
|
+
value: 'goldenJackpotMinMultiplier'
|
|
16
|
+
},
|
|
17
|
+
{ name: 'Slots Minimum Multiplier', value: 'slotsMinMultiplier' },
|
|
18
|
+
{ name: 'Dice Minimum Multiplier', value: 'diceMinMultiplier' },
|
|
19
|
+
{ name: 'Coin Flip Minimum Multiplier', value: 'coinflipMinMultiplier' },
|
|
20
|
+
{ name: 'Lottery Minimum Multiplier', value: 'lotteryMinMultiplier' },
|
|
21
|
+
{ name: 'Roulette Minimum Multiplier', value: 'rouletteMinMultiplier' },
|
|
22
|
+
{ name: 'Blackjack Minimum Multiplier', value: 'blackjackMinMultiplier' }
|
|
12
23
|
];
|
|
13
24
|
exports.readableGameNames = [
|
|
14
25
|
{ name: 'Dice', value: 'dice' },
|
|
@@ -21,7 +32,8 @@ exports.readableGameNames = [
|
|
|
21
32
|
{ name: 'Blackjack', value: 'blackjack' },
|
|
22
33
|
{ name: 'Prediction', value: 'prediction' },
|
|
23
34
|
{ name: 'Raffle', value: 'raffle' },
|
|
24
|
-
{ name: 'Plinko', value: 'plinko' }
|
|
35
|
+
{ name: 'Plinko', value: 'plinko' },
|
|
36
|
+
{ name: 'Win Announcements', value: 'winAnnouncements' }
|
|
25
37
|
];
|
|
26
38
|
exports.defaultCasinoSettings = {
|
|
27
39
|
dice: {
|
|
@@ -111,5 +123,15 @@ exports.defaultCasinoSettings = {
|
|
|
111
123
|
},
|
|
112
124
|
maxBet: 0,
|
|
113
125
|
minBet: 0
|
|
126
|
+
},
|
|
127
|
+
winAnnouncements: {
|
|
128
|
+
plinkoMinMultiplier: 6,
|
|
129
|
+
goldenJackpotMinMultiplier: 1,
|
|
130
|
+
slotsMinMultiplier: 100,
|
|
131
|
+
lotteryMinMultiplier: 40,
|
|
132
|
+
rouletteMinMultiplier: 18,
|
|
133
|
+
blackjackMinMultiplier: 2.5,
|
|
134
|
+
diceMinMultiplier: 0,
|
|
135
|
+
coinflipMinMultiplier: 0
|
|
114
136
|
}
|
|
115
137
|
};
|
package/dist/constants/index.js
CHANGED
|
@@ -69,6 +69,9 @@ const getPlinkoMultiplierAtPathIndex = (binMultipliers, pathIndex) => {
|
|
|
69
69
|
exports.getPlinkoMultiplierAtPathIndex = getPlinkoMultiplierAtPathIndex;
|
|
70
70
|
const formatPlinkoBinMultipliersForDisplay = (binMultipliers) => {
|
|
71
71
|
const normalized = (0, exports.normalizePlinkoBinMultipliers)(binMultipliers);
|
|
72
|
-
return Object.fromEntries(exports.PLINKO_EDITABLE_BINS.map((bin) => [
|
|
72
|
+
return Object.fromEntries(exports.PLINKO_EDITABLE_BINS.map((bin) => [
|
|
73
|
+
String(bin),
|
|
74
|
+
plinkoBinAt(normalized, bin)
|
|
75
|
+
]));
|
|
73
76
|
};
|
|
74
77
|
exports.formatPlinkoBinMultipliersForDisplay = formatPlinkoBinMultipliersForDisplay;
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TAtmRequest } from '../types';
|
|
3
|
+
export declare const AtmRequestSchema: Schema<TAtmRequest, import("mongoose").Model<TAtmRequest, any, any, any, (import("mongoose").Document<unknown, any, TAtmRequest, any, import("mongoose").DefaultSchemaOptions> & TAtmRequest & {
|
|
4
|
+
_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
} & {
|
|
8
|
+
id: string;
|
|
9
|
+
}) | (import("mongoose").Document<unknown, any, TAtmRequest, any, import("mongoose").DefaultSchemaOptions> & TAtmRequest & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
} & {
|
|
12
|
+
__v: number;
|
|
13
|
+
}), any, TAtmRequest>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, "id"> & {
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
requestId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
25
|
+
_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
} & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, "id"> & {
|
|
29
|
+
id: string;
|
|
30
|
+
}> | undefined;
|
|
31
|
+
guildId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
32
|
+
id: string;
|
|
33
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}, "id"> & {
|
|
38
|
+
id: string;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
userId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
41
|
+
id: string;
|
|
42
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}, "id"> & {
|
|
47
|
+
id: string;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
type?: import("mongoose").SchemaDefinitionProperty<"deposit" | "withdraw", TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
58
|
+
amount?: import("mongoose").SchemaDefinitionProperty<number, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
59
|
+
id: string;
|
|
60
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
61
|
+
_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
} & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, "id"> & {
|
|
65
|
+
id: string;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
account?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
68
|
+
id: string;
|
|
69
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
70
|
+
_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
} & {
|
|
72
|
+
__v: number;
|
|
73
|
+
}, "id"> & {
|
|
74
|
+
id: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
status?: import("mongoose").SchemaDefinitionProperty<"pending" | "approved" | "rejected", TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
77
|
+
id: string;
|
|
78
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
79
|
+
_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, "id"> & {
|
|
83
|
+
id: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
handledBy?: import("mongoose").SchemaDefinitionProperty<string | undefined, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
86
|
+
id: string;
|
|
87
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
88
|
+
_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
} & {
|
|
90
|
+
__v: number;
|
|
91
|
+
}, "id"> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> | undefined;
|
|
94
|
+
handledAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
95
|
+
id: string;
|
|
96
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
} & {
|
|
99
|
+
__v: number;
|
|
100
|
+
}, "id"> & {
|
|
101
|
+
id: string;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
logChannelId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
104
|
+
id: string;
|
|
105
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
|
107
|
+
} & {
|
|
108
|
+
__v: number;
|
|
109
|
+
}, "id"> & {
|
|
110
|
+
id: string;
|
|
111
|
+
}> | undefined;
|
|
112
|
+
logMessageId?: import("mongoose").SchemaDefinitionProperty<string, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
113
|
+
id: string;
|
|
114
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
} & {
|
|
117
|
+
__v: number;
|
|
118
|
+
}, "id"> & {
|
|
119
|
+
id: string;
|
|
120
|
+
}> | undefined;
|
|
121
|
+
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
122
|
+
id: string;
|
|
123
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
124
|
+
_id: import("mongoose").Types.ObjectId;
|
|
125
|
+
} & {
|
|
126
|
+
__v: number;
|
|
127
|
+
}, "id"> & {
|
|
128
|
+
id: string;
|
|
129
|
+
}> | undefined;
|
|
130
|
+
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TAtmRequest, import("mongoose").Document<unknown, {}, TAtmRequest, {
|
|
131
|
+
id: string;
|
|
132
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TAtmRequest & {
|
|
133
|
+
_id: import("mongoose").Types.ObjectId;
|
|
134
|
+
} & {
|
|
135
|
+
__v: number;
|
|
136
|
+
}, "id"> & {
|
|
137
|
+
id: string;
|
|
138
|
+
}> | undefined;
|
|
139
|
+
}, TAtmRequest>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AtmRequestSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.AtmRequestSchema = new mongoose_1.Schema({
|
|
6
|
+
requestId: { type: String, required: true, unique: true },
|
|
7
|
+
guildId: { type: String, required: true, index: true },
|
|
8
|
+
userId: { type: String, required: true, index: true },
|
|
9
|
+
type: { type: String, enum: ['deposit', 'withdraw'], required: true },
|
|
10
|
+
amount: { type: Number, required: true, min: 1 },
|
|
11
|
+
account: { type: String, required: true },
|
|
12
|
+
status: {
|
|
13
|
+
type: String,
|
|
14
|
+
enum: ['pending', 'approved', 'rejected'],
|
|
15
|
+
required: true,
|
|
16
|
+
default: 'pending',
|
|
17
|
+
index: true
|
|
18
|
+
},
|
|
19
|
+
handledBy: { type: String },
|
|
20
|
+
handledAt: { type: Date },
|
|
21
|
+
logChannelId: { type: String },
|
|
22
|
+
logMessageId: { type: String }
|
|
23
|
+
}, { timestamps: true });
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TBlackjackGame, TBlackjackHand } from '../types';
|
|
3
|
+
export declare const BlackjackGameSchema: Schema<TBlackjackGame, import("mongoose").Model<TBlackjackGame, any, any, any, (import("mongoose").Document<unknown, any, TBlackjackGame, any, import("mongoose").DefaultSchemaOptions> & TBlackjackGame & {
|
|
4
|
+
_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
} & {
|
|
8
|
+
id: string;
|
|
9
|
+
}) | (import("mongoose").Document<unknown, any, TBlackjackGame, any, import("mongoose").DefaultSchemaOptions> & TBlackjackGame & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
} & {
|
|
12
|
+
__v: number;
|
|
13
|
+
}), any, TBlackjackGame>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, "id"> & {
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
userId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
25
|
+
_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
} & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, "id"> & {
|
|
29
|
+
id: string;
|
|
30
|
+
}> | undefined;
|
|
31
|
+
guildId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
32
|
+
id: string;
|
|
33
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}, "id"> & {
|
|
38
|
+
id: string;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
channelId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
41
|
+
id: string;
|
|
42
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}, "id"> & {
|
|
47
|
+
id: string;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
messageId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
58
|
+
betId?: import("mongoose").SchemaDefinitionProperty<string, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
59
|
+
id: string;
|
|
60
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
61
|
+
_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
} & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, "id"> & {
|
|
65
|
+
id: string;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
deck?: import("mongoose").SchemaDefinitionProperty<import("../types").Card[], TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
68
|
+
id: string;
|
|
69
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
70
|
+
_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
} & {
|
|
72
|
+
__v: number;
|
|
73
|
+
}, "id"> & {
|
|
74
|
+
id: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
deckIndex?: import("mongoose").SchemaDefinitionProperty<number, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
77
|
+
id: string;
|
|
78
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
79
|
+
_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, "id"> & {
|
|
83
|
+
id: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
hands?: import("mongoose").SchemaDefinitionProperty<TBlackjackHand[], TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
86
|
+
id: string;
|
|
87
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
88
|
+
_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
} & {
|
|
90
|
+
__v: number;
|
|
91
|
+
}, "id"> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> | undefined;
|
|
94
|
+
activeHandIndex?: import("mongoose").SchemaDefinitionProperty<number, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
95
|
+
id: string;
|
|
96
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
} & {
|
|
99
|
+
__v: number;
|
|
100
|
+
}, "id"> & {
|
|
101
|
+
id: string;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
phase?: import("mongoose").SchemaDefinitionProperty<import("../types").GamePhase, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
104
|
+
id: string;
|
|
105
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
|
107
|
+
} & {
|
|
108
|
+
__v: number;
|
|
109
|
+
}, "id"> & {
|
|
110
|
+
id: string;
|
|
111
|
+
}> | undefined;
|
|
112
|
+
dealerCards?: import("mongoose").SchemaDefinitionProperty<import("../types").Card[], TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
113
|
+
id: string;
|
|
114
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
} & {
|
|
117
|
+
__v: number;
|
|
118
|
+
}, "id"> & {
|
|
119
|
+
id: string;
|
|
120
|
+
}> | undefined;
|
|
121
|
+
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
122
|
+
id: string;
|
|
123
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
124
|
+
_id: import("mongoose").Types.ObjectId;
|
|
125
|
+
} & {
|
|
126
|
+
__v: number;
|
|
127
|
+
}, "id"> & {
|
|
128
|
+
id: string;
|
|
129
|
+
}> | undefined;
|
|
130
|
+
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TBlackjackGame, import("mongoose").Document<unknown, {}, TBlackjackGame, {
|
|
131
|
+
id: string;
|
|
132
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TBlackjackGame & {
|
|
133
|
+
_id: import("mongoose").Types.ObjectId;
|
|
134
|
+
} & {
|
|
135
|
+
__v: number;
|
|
136
|
+
}, "id"> & {
|
|
137
|
+
id: string;
|
|
138
|
+
}> | undefined;
|
|
139
|
+
}, TBlackjackGame>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlackjackGameSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const cardSchema = {
|
|
6
|
+
suite: { type: String, required: true },
|
|
7
|
+
label: { type: String, required: true },
|
|
8
|
+
value: { type: Number, required: true }
|
|
9
|
+
};
|
|
10
|
+
const handSchema = new mongoose_1.Schema({
|
|
11
|
+
cards: [cardSchema],
|
|
12
|
+
betAmount: { type: Number, required: true },
|
|
13
|
+
finished: { type: Boolean, required: true, default: false },
|
|
14
|
+
isSplitHand: { type: Boolean, required: true, default: false }
|
|
15
|
+
}, { _id: false });
|
|
16
|
+
exports.BlackjackGameSchema = new mongoose_1.Schema({
|
|
17
|
+
userId: { type: String, required: true, index: true },
|
|
18
|
+
guildId: { type: String, required: true, index: true },
|
|
19
|
+
channelId: { type: String, required: true },
|
|
20
|
+
messageId: { type: String, required: true },
|
|
21
|
+
betId: { type: String, required: true, index: true },
|
|
22
|
+
deck: [cardSchema],
|
|
23
|
+
deckIndex: { type: Number, required: true, default: 0 },
|
|
24
|
+
hands: { type: [handSchema], required: true, default: [] },
|
|
25
|
+
phase: {
|
|
26
|
+
type: String,
|
|
27
|
+
enum: ['PLAYER', 'DEALER', 'FINISHED'],
|
|
28
|
+
required: true,
|
|
29
|
+
default: 'PLAYER'
|
|
30
|
+
},
|
|
31
|
+
activeHandIndex: { type: Number, required: true, default: 0 },
|
|
32
|
+
dealerCards: [cardSchema]
|
|
33
|
+
}, { timestamps: true });
|
|
34
|
+
exports.BlackjackGameSchema.index({ userId: 1, guildId: 1 }, { unique: true });
|
|
@@ -49,6 +49,15 @@ export declare const GuildConfigurationSchema: Schema<TGuildConfiguration, impor
|
|
|
49
49
|
}, "id"> & {
|
|
50
50
|
id: string;
|
|
51
51
|
}> | undefined;
|
|
52
|
+
winAnnouncementsChannelId?: import("mongoose").SchemaDefinitionProperty<string, TGuildConfiguration, import("mongoose").Document<unknown, {}, TGuildConfiguration, {
|
|
53
|
+
id: string;
|
|
54
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TGuildConfiguration & {
|
|
55
|
+
_id: import("mongoose").Types.ObjectId;
|
|
56
|
+
} & {
|
|
57
|
+
__v: number;
|
|
58
|
+
}, "id"> & {
|
|
59
|
+
id: string;
|
|
60
|
+
}> | undefined;
|
|
52
61
|
predictionChannelIds?: import("mongoose").SchemaDefinitionProperty<{
|
|
53
62
|
actions: string;
|
|
54
63
|
logs: string;
|
|
@@ -171,6 +180,16 @@ export declare const GuildConfigurationSchema: Schema<TGuildConfiguration, impor
|
|
|
171
180
|
maxBet: number;
|
|
172
181
|
minBet: number;
|
|
173
182
|
};
|
|
183
|
+
winAnnouncements: {
|
|
184
|
+
plinkoMinMultiplier: number;
|
|
185
|
+
goldenJackpotMinMultiplier: number;
|
|
186
|
+
slotsMinMultiplier: number;
|
|
187
|
+
lotteryMinMultiplier: number;
|
|
188
|
+
rouletteMinMultiplier: number;
|
|
189
|
+
blackjackMinMultiplier: number;
|
|
190
|
+
diceMinMultiplier: number;
|
|
191
|
+
coinflipMinMultiplier: number;
|
|
192
|
+
};
|
|
174
193
|
}, TGuildConfiguration, import("mongoose").Document<unknown, {}, TGuildConfiguration, {
|
|
175
194
|
id: string;
|
|
176
195
|
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TGuildConfiguration & {
|
package/dist/mongoose/index.d.ts
CHANGED
|
@@ -3,3 +3,6 @@ export * from './vipRoom.schema';
|
|
|
3
3
|
export * from './prediction.schema';
|
|
4
4
|
export * from './transaction.schema';
|
|
5
5
|
export * from './guildConfiguration.schema';
|
|
6
|
+
export * from './atmRequest.schema';
|
|
7
|
+
export * from './raffle.schema';
|
|
8
|
+
export * from './blackjackGame.schema';
|
package/dist/mongoose/index.js
CHANGED
|
@@ -19,3 +19,6 @@ __exportStar(require("./vipRoom.schema"), exports);
|
|
|
19
19
|
__exportStar(require("./prediction.schema"), exports);
|
|
20
20
|
__exportStar(require("./transaction.schema"), exports);
|
|
21
21
|
__exportStar(require("./guildConfiguration.schema"), exports);
|
|
22
|
+
__exportStar(require("./atmRequest.schema"), exports);
|
|
23
|
+
__exportStar(require("./raffle.schema"), exports);
|
|
24
|
+
__exportStar(require("./blackjackGame.schema"), exports);
|
|
@@ -5,23 +5,23 @@ const mongoose_1 = require("mongoose");
|
|
|
5
5
|
exports.PredictionSchema = new mongoose_1.Schema({
|
|
6
6
|
predictionId: {
|
|
7
7
|
type: String,
|
|
8
|
-
required: true
|
|
8
|
+
required: true
|
|
9
9
|
},
|
|
10
10
|
guildId: {
|
|
11
11
|
type: String,
|
|
12
|
-
required: true
|
|
12
|
+
required: true
|
|
13
13
|
},
|
|
14
14
|
channelId: {
|
|
15
15
|
type: String,
|
|
16
|
-
required: true
|
|
16
|
+
required: true
|
|
17
17
|
},
|
|
18
18
|
creatorId: {
|
|
19
19
|
type: String,
|
|
20
|
-
required: true
|
|
20
|
+
required: true
|
|
21
21
|
},
|
|
22
22
|
title: {
|
|
23
23
|
type: String,
|
|
24
|
-
required: true
|
|
24
|
+
required: true
|
|
25
25
|
},
|
|
26
26
|
choices: [
|
|
27
27
|
{
|
|
@@ -30,20 +30,20 @@ exports.PredictionSchema = new mongoose_1.Schema({
|
|
|
30
30
|
bets: [
|
|
31
31
|
{
|
|
32
32
|
userId: { type: String, required: true },
|
|
33
|
-
amount: { type: Number, required: true }
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
33
|
+
amount: { type: Number, required: true }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
37
|
],
|
|
38
38
|
status: {
|
|
39
39
|
type: String,
|
|
40
40
|
enum: ['active', 'ended', 'paid', 'canceled'],
|
|
41
|
-
default: 'active'
|
|
41
|
+
default: 'active'
|
|
42
42
|
},
|
|
43
43
|
autolock: {
|
|
44
44
|
type: Date,
|
|
45
45
|
required: false,
|
|
46
|
-
default: null
|
|
47
|
-
}
|
|
46
|
+
default: null
|
|
47
|
+
}
|
|
48
48
|
}, { timestamps: true });
|
|
49
49
|
exports.PredictionSchema.index({ predictionId: 1, guildId: 1 }, { unique: true });
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { TRaffle } from '../types';
|
|
3
|
+
export declare const RaffleSchema: Schema<TRaffle, import("mongoose").Model<TRaffle, any, any, any, (import("mongoose").Document<unknown, any, TRaffle, any, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
4
|
+
_id: import("mongoose").Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
} & {
|
|
8
|
+
id: string;
|
|
9
|
+
}) | (import("mongoose").Document<unknown, any, TRaffle, any, import("mongoose").DefaultSchemaOptions> & TRaffle & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
} & {
|
|
12
|
+
__v: number;
|
|
13
|
+
}), any, TRaffle>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
14
|
+
id: string;
|
|
15
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
16
|
+
_id: import("mongoose").Types.ObjectId;
|
|
17
|
+
} & {
|
|
18
|
+
__v: number;
|
|
19
|
+
}, "id"> & {
|
|
20
|
+
id: string;
|
|
21
|
+
}, {
|
|
22
|
+
drawId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
23
|
+
id: string;
|
|
24
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
25
|
+
_id: import("mongoose").Types.ObjectId;
|
|
26
|
+
} & {
|
|
27
|
+
__v: number;
|
|
28
|
+
}, "id"> & {
|
|
29
|
+
id: string;
|
|
30
|
+
}> | undefined;
|
|
31
|
+
raffleId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
32
|
+
id: string;
|
|
33
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
} & {
|
|
36
|
+
__v: number;
|
|
37
|
+
}, "id"> & {
|
|
38
|
+
id: string;
|
|
39
|
+
}> | undefined;
|
|
40
|
+
guildId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
41
|
+
id: string;
|
|
42
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}, "id"> & {
|
|
47
|
+
id: string;
|
|
48
|
+
}> | undefined;
|
|
49
|
+
channelId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
50
|
+
id: string;
|
|
51
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
52
|
+
_id: import("mongoose").Types.ObjectId;
|
|
53
|
+
} & {
|
|
54
|
+
__v: number;
|
|
55
|
+
}, "id"> & {
|
|
56
|
+
id: string;
|
|
57
|
+
}> | undefined;
|
|
58
|
+
creatorId?: import("mongoose").SchemaDefinitionProperty<string, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
59
|
+
id: string;
|
|
60
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
61
|
+
_id: import("mongoose").Types.ObjectId;
|
|
62
|
+
} & {
|
|
63
|
+
__v: number;
|
|
64
|
+
}, "id"> & {
|
|
65
|
+
id: string;
|
|
66
|
+
}> | undefined;
|
|
67
|
+
ticketPrice?: import("mongoose").SchemaDefinitionProperty<number, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
68
|
+
id: string;
|
|
69
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
70
|
+
_id: import("mongoose").Types.ObjectId;
|
|
71
|
+
} & {
|
|
72
|
+
__v: number;
|
|
73
|
+
}, "id"> & {
|
|
74
|
+
id: string;
|
|
75
|
+
}> | undefined;
|
|
76
|
+
maxTicketsPerUser?: import("mongoose").SchemaDefinitionProperty<number, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
77
|
+
id: string;
|
|
78
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
79
|
+
_id: import("mongoose").Types.ObjectId;
|
|
80
|
+
} & {
|
|
81
|
+
__v: number;
|
|
82
|
+
}, "id"> & {
|
|
83
|
+
id: string;
|
|
84
|
+
}> | undefined;
|
|
85
|
+
nextDrawAt?: import("mongoose").SchemaDefinitionProperty<Date, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
86
|
+
id: string;
|
|
87
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
88
|
+
_id: import("mongoose").Types.ObjectId;
|
|
89
|
+
} & {
|
|
90
|
+
__v: number;
|
|
91
|
+
}, "id"> & {
|
|
92
|
+
id: string;
|
|
93
|
+
}> | undefined;
|
|
94
|
+
lastDrawAt?: import("mongoose").SchemaDefinitionProperty<Date | undefined, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
95
|
+
id: string;
|
|
96
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
} & {
|
|
99
|
+
__v: number;
|
|
100
|
+
}, "id"> & {
|
|
101
|
+
id: string;
|
|
102
|
+
}> | undefined;
|
|
103
|
+
drawIntervalMs?: import("mongoose").SchemaDefinitionProperty<number, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
104
|
+
id: string;
|
|
105
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
|
107
|
+
} & {
|
|
108
|
+
__v: number;
|
|
109
|
+
}, "id"> & {
|
|
110
|
+
id: string;
|
|
111
|
+
}> | undefined;
|
|
112
|
+
status?: import("mongoose").SchemaDefinitionProperty<"active" | "canceled", TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
113
|
+
id: string;
|
|
114
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
} & {
|
|
117
|
+
__v: number;
|
|
118
|
+
}, "id"> & {
|
|
119
|
+
id: string;
|
|
120
|
+
}> | undefined;
|
|
121
|
+
participants?: import("mongoose").SchemaDefinitionProperty<{
|
|
122
|
+
userId: string;
|
|
123
|
+
tickets: number;
|
|
124
|
+
}[], TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
125
|
+
id: string;
|
|
126
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
127
|
+
_id: import("mongoose").Types.ObjectId;
|
|
128
|
+
} & {
|
|
129
|
+
__v: number;
|
|
130
|
+
}, "id"> & {
|
|
131
|
+
id: string;
|
|
132
|
+
}> | undefined;
|
|
133
|
+
createdAt?: import("mongoose").SchemaDefinitionProperty<Date, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
134
|
+
id: string;
|
|
135
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
136
|
+
_id: import("mongoose").Types.ObjectId;
|
|
137
|
+
} & {
|
|
138
|
+
__v: number;
|
|
139
|
+
}, "id"> & {
|
|
140
|
+
id: string;
|
|
141
|
+
}> | undefined;
|
|
142
|
+
updatedAt?: import("mongoose").SchemaDefinitionProperty<Date, TRaffle, import("mongoose").Document<unknown, {}, TRaffle, {
|
|
143
|
+
id: string;
|
|
144
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TRaffle & {
|
|
145
|
+
_id: import("mongoose").Types.ObjectId;
|
|
146
|
+
} & {
|
|
147
|
+
__v: number;
|
|
148
|
+
}, "id"> & {
|
|
149
|
+
id: string;
|
|
150
|
+
}> | undefined;
|
|
151
|
+
}, TRaffle>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RaffleSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.RaffleSchema = new mongoose_1.Schema({
|
|
6
|
+
drawId: { type: String, required: true },
|
|
7
|
+
raffleId: { type: String, required: true },
|
|
8
|
+
guildId: { type: String, required: true, index: true },
|
|
9
|
+
channelId: { type: String, required: true },
|
|
10
|
+
creatorId: { type: String, required: true },
|
|
11
|
+
ticketPrice: { type: Number, required: true, min: 1 },
|
|
12
|
+
maxTicketsPerUser: { type: Number, required: true, min: 1 },
|
|
13
|
+
nextDrawAt: { type: Date, required: true },
|
|
14
|
+
lastDrawAt: { type: Date },
|
|
15
|
+
drawIntervalMs: { type: Number, required: true, min: 1 },
|
|
16
|
+
status: {
|
|
17
|
+
type: String,
|
|
18
|
+
enum: ['active', 'canceled'],
|
|
19
|
+
default: 'active',
|
|
20
|
+
index: true
|
|
21
|
+
},
|
|
22
|
+
participants: [
|
|
23
|
+
{
|
|
24
|
+
userId: { type: String, required: true },
|
|
25
|
+
tickets: { type: Number, required: true, min: 1 }
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}, { timestamps: true });
|
|
29
|
+
exports.RaffleSchema.index({ raffleId: 1 }, { unique: true });
|
|
@@ -64,7 +64,7 @@ export declare const TransactionSchema: Schema<TTransaction, import("mongoose").
|
|
|
64
64
|
}, "id"> & {
|
|
65
65
|
id: string;
|
|
66
66
|
}> | undefined;
|
|
67
|
-
meta?: import("mongoose").SchemaDefinitionProperty<Record<string,
|
|
67
|
+
meta?: import("mongoose").SchemaDefinitionProperty<Record<string, unknown> | undefined, TTransaction, import("mongoose").Document<unknown, {}, TTransaction, {
|
|
68
68
|
id: string;
|
|
69
69
|
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TTransaction & {
|
|
70
70
|
_id: import("mongoose").Types.ObjectId;
|
|
@@ -8,9 +8,9 @@ exports.VipRoomSchema = new mongoose_1.Schema({
|
|
|
8
8
|
channelId: { type: String, required: true },
|
|
9
9
|
memberIds: {
|
|
10
10
|
type: [String],
|
|
11
|
-
default: []
|
|
11
|
+
default: []
|
|
12
12
|
},
|
|
13
|
-
expiresAt: { type: Date, required: true }
|
|
13
|
+
expiresAt: { type: Date, required: true }
|
|
14
14
|
}, { timestamps: true });
|
|
15
15
|
exports.VipRoomSchema.index({ expiresAt: 1 });
|
|
16
16
|
exports.VipRoomSchema.index({ ownerId: 1, guildId: 1 }, { unique: true });
|
package/dist/schemas/forms.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare const atmChannelsFormSchema: z.ZodObject<{
|
|
|
5
5
|
}, z.core.$strip>;
|
|
6
6
|
export declare const casinoChannelsFormSchema: z.ZodObject<{
|
|
7
7
|
casinoChannelIds: z.ZodArray<z.ZodString>;
|
|
8
|
+
winAnnouncementsChannelId: z.ZodString;
|
|
8
9
|
}, z.core.$strip>;
|
|
9
10
|
export declare const predictionChannelsFormSchema: z.ZodObject<{
|
|
10
11
|
actions: z.ZodString;
|
|
@@ -21,6 +22,7 @@ export declare const channelsFormSchema: z.ZodObject<{
|
|
|
21
22
|
}, z.core.$strip>;
|
|
22
23
|
casino: z.ZodObject<{
|
|
23
24
|
casinoChannelIds: z.ZodArray<z.ZodString>;
|
|
25
|
+
winAnnouncementsChannelId: z.ZodString;
|
|
24
26
|
}, z.core.$strip>;
|
|
25
27
|
prediction: z.ZodObject<{
|
|
26
28
|
actions: z.ZodString;
|
|
@@ -95,6 +97,16 @@ export declare const casinoSettingsSchema: z.ZodObject<{
|
|
|
95
97
|
minBet: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
96
98
|
maxBet: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
97
99
|
}, z.core.$strip>;
|
|
100
|
+
winAnnouncements: z.ZodObject<{
|
|
101
|
+
plinkoMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
102
|
+
goldenJackpotMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
103
|
+
slotsMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
104
|
+
lotteryMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
105
|
+
rouletteMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
106
|
+
blackjackMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
107
|
+
diceMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
108
|
+
coinflipMinMultiplier: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>, z.ZodNumber>;
|
|
109
|
+
}, z.core.$strip>;
|
|
98
110
|
}, z.core.$strip>;
|
|
99
111
|
export declare const vipSettingsFormSchema: z.ZodObject<{
|
|
100
112
|
roleOwnerId: z.ZodString;
|
package/dist/schemas/forms.js
CHANGED
|
@@ -5,26 +5,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.bonusFormSchema = exports.globalSettingsFormSchema = exports.managerRoleFormSchema = exports.vipSettingsFormSchema = exports.casinoSettingsSchema = exports.channelsFormSchema = exports.raffleChannelsFormSchema = exports.predictionChannelsFormSchema = exports.casinoChannelsFormSchema = exports.atmChannelsFormSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
|
-
const commonTimezones_1 = require("../constants/commonTimezones");
|
|
9
8
|
const bonusLimits_1 = require("../constants/bonusLimits");
|
|
9
|
+
const commonTimezones_1 = require("../constants/commonTimezones");
|
|
10
10
|
const plinkoConfig_1 = require("../constants/plinkoConfig");
|
|
11
|
-
const NO_CHANNEL = 'At least one channel must be selected.';
|
|
12
11
|
exports.atmChannelsFormSchema = zod_1.default.object({
|
|
13
|
-
actions: zod_1.default.string()
|
|
14
|
-
logs: zod_1.default.string()
|
|
12
|
+
actions: zod_1.default.string(),
|
|
13
|
+
logs: zod_1.default.string()
|
|
15
14
|
});
|
|
16
15
|
exports.casinoChannelsFormSchema = zod_1.default.object({
|
|
17
|
-
casinoChannelIds: zod_1.default
|
|
18
|
-
|
|
19
|
-
.min(1, { message: NO_CHANNEL })
|
|
16
|
+
casinoChannelIds: zod_1.default.array(zod_1.default.string()),
|
|
17
|
+
winAnnouncementsChannelId: zod_1.default.string()
|
|
20
18
|
});
|
|
21
19
|
exports.predictionChannelsFormSchema = zod_1.default.object({
|
|
22
|
-
actions: zod_1.default.string()
|
|
23
|
-
logs: zod_1.default.string()
|
|
20
|
+
actions: zod_1.default.string(),
|
|
21
|
+
logs: zod_1.default.string()
|
|
24
22
|
});
|
|
25
23
|
exports.raffleChannelsFormSchema = zod_1.default.object({
|
|
26
|
-
actions: zod_1.default.string()
|
|
27
|
-
logs: zod_1.default.string()
|
|
24
|
+
actions: zod_1.default.string(),
|
|
25
|
+
logs: zod_1.default.string()
|
|
28
26
|
});
|
|
29
27
|
exports.channelsFormSchema = zod_1.default.object({
|
|
30
28
|
atm: exports.atmChannelsFormSchema,
|
|
@@ -96,19 +94,29 @@ exports.casinoSettingsSchema = zod_1.default.object({
|
|
|
96
94
|
.transform(plinkoConfig_1.normalizePlinkoBinMultipliers),
|
|
97
95
|
minBet: num,
|
|
98
96
|
maxBet: num
|
|
97
|
+
}),
|
|
98
|
+
winAnnouncements: zod_1.default.object({
|
|
99
|
+
plinkoMinMultiplier: num,
|
|
100
|
+
goldenJackpotMinMultiplier: num,
|
|
101
|
+
slotsMinMultiplier: num,
|
|
102
|
+
lotteryMinMultiplier: num,
|
|
103
|
+
rouletteMinMultiplier: num,
|
|
104
|
+
blackjackMinMultiplier: num,
|
|
105
|
+
diceMinMultiplier: num,
|
|
106
|
+
coinflipMinMultiplier: num
|
|
99
107
|
})
|
|
100
108
|
});
|
|
101
109
|
exports.vipSettingsFormSchema = zod_1.default.object({
|
|
102
|
-
roleOwnerId: zod_1.default.string()
|
|
103
|
-
roleMemberId: zod_1.default.string()
|
|
110
|
+
roleOwnerId: zod_1.default.string(),
|
|
111
|
+
roleMemberId: zod_1.default.string(),
|
|
104
112
|
pricePerDay: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
105
113
|
pricePerCreate: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
106
114
|
pricePerAdditionalMember: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
107
115
|
maxMembers: zod_1.default.number().min(0, 'Must be ≥ 0'),
|
|
108
|
-
categoryId: zod_1.default.string()
|
|
116
|
+
categoryId: zod_1.default.string()
|
|
109
117
|
});
|
|
110
118
|
exports.managerRoleFormSchema = zod_1.default.object({
|
|
111
|
-
managerRoleId: zod_1.default.string()
|
|
119
|
+
managerRoleId: zod_1.default.string()
|
|
112
120
|
});
|
|
113
121
|
const bonusAmountSchema = zod_1.default
|
|
114
122
|
.number()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TAtmRequest = {
|
|
2
|
+
requestId: string;
|
|
3
|
+
guildId: string;
|
|
4
|
+
userId: string;
|
|
5
|
+
type: 'deposit' | 'withdraw';
|
|
6
|
+
amount: number;
|
|
7
|
+
account: string;
|
|
8
|
+
status: 'pending' | 'approved' | 'rejected';
|
|
9
|
+
handledBy?: string;
|
|
10
|
+
handledAt?: Date;
|
|
11
|
+
logChannelId: string;
|
|
12
|
+
logMessageId: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SUITES, VALUES } from '../constants/blackjack';
|
|
2
|
+
export type Suite = (typeof SUITES)[number];
|
|
3
|
+
export type CardLabel = (typeof VALUES)[number]['label'];
|
|
4
|
+
export type Card = {
|
|
5
|
+
suite: Suite;
|
|
6
|
+
label: CardLabel;
|
|
7
|
+
value: number;
|
|
8
|
+
};
|
|
9
|
+
export type GamePhase = 'PLAYER' | 'DEALER' | 'FINISHED';
|
|
10
|
+
export type TBlackjackHand = {
|
|
11
|
+
cards: Card[];
|
|
12
|
+
betAmount: number;
|
|
13
|
+
finished: boolean;
|
|
14
|
+
isSplitHand: boolean;
|
|
15
|
+
};
|
|
16
|
+
export type TBlackjackGame = {
|
|
17
|
+
userId: string;
|
|
18
|
+
guildId: string;
|
|
19
|
+
channelId: string;
|
|
20
|
+
messageId: string;
|
|
21
|
+
betId: string;
|
|
22
|
+
deck: Card[];
|
|
23
|
+
deckIndex: number;
|
|
24
|
+
hands: TBlackjackHand[];
|
|
25
|
+
activeHandIndex: number;
|
|
26
|
+
phase: GamePhase;
|
|
27
|
+
dealerCards: Card[];
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
updatedAt: Date;
|
|
30
|
+
};
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -19,5 +19,8 @@ __exportStar(require("./vipRoom"), exports);
|
|
|
19
19
|
__exportStar(require("./prediction"), exports);
|
|
20
20
|
__exportStar(require("./transaction"), exports);
|
|
21
21
|
__exportStar(require("./guildConfiguration"), exports);
|
|
22
|
+
__exportStar(require("./atmRequest"), exports);
|
|
23
|
+
__exportStar(require("./raffle"), exports);
|
|
24
|
+
__exportStar(require("./blackjackGame"), exports);
|
|
22
25
|
// No db
|
|
23
26
|
__exportStar(require("./bonus"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type TRaffle = {
|
|
2
|
+
drawId: string;
|
|
3
|
+
raffleId: string;
|
|
4
|
+
guildId: string;
|
|
5
|
+
channelId: string;
|
|
6
|
+
creatorId: string;
|
|
7
|
+
ticketPrice: number;
|
|
8
|
+
maxTicketsPerUser: number;
|
|
9
|
+
nextDrawAt: Date;
|
|
10
|
+
lastDrawAt?: Date;
|
|
11
|
+
drawIntervalMs: number;
|
|
12
|
+
status: 'active' | 'canceled';
|
|
13
|
+
participants: {
|
|
14
|
+
userId: string;
|
|
15
|
+
tickets: number;
|
|
16
|
+
}[];
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
};
|
|
@@ -4,7 +4,7 @@ export type TTransaction = {
|
|
|
4
4
|
amount: number;
|
|
5
5
|
type: 'deposit' | 'withdraw' | 'bet' | 'win' | 'refund' | 'bonus' | 'vip';
|
|
6
6
|
source: 'command' | 'manual' | 'web' | 'system' | 'casino';
|
|
7
|
-
meta?: Record<string,
|
|
7
|
+
meta?: Record<string, unknown>;
|
|
8
8
|
betId?: string;
|
|
9
9
|
handledBy?: string;
|
|
10
10
|
createdAt: Date;
|
|
@@ -8,8 +8,7 @@ const getCycleLength = (rewardMode, baseReward, maxReward, streakIncrement, stre
|
|
|
8
8
|
: 1;
|
|
9
9
|
}
|
|
10
10
|
return streakMultiplier > 1
|
|
11
|
-
? Math.floor(Math.log(maxReward / baseReward) / Math.log(streakMultiplier)) +
|
|
12
|
-
1
|
|
11
|
+
? Math.floor(Math.log(maxReward / baseReward) / Math.log(streakMultiplier)) + 1
|
|
13
12
|
: 1;
|
|
14
13
|
};
|
|
15
14
|
const calculateBonusReward = ({ streak, settings }) => {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ export * from './generateBonusPreview';
|
|
|
5
5
|
export * from './formatters';
|
|
6
6
|
export * from './globalSettings';
|
|
7
7
|
export * from './normalizeGlobalSettings';
|
|
8
|
+
export * from './normalizeCasinoSettings';
|
|
8
9
|
export * from './guildTimezone';
|
|
9
10
|
export * from './generateId';
|
|
10
11
|
export * from './parseTimeToSeconds';
|
|
11
12
|
export * from './validateBetAmount';
|
|
12
13
|
export * from './bonusStreak';
|
|
13
14
|
export * from './validatePredictionBet';
|
|
15
|
+
export * from './winAnnouncements';
|
package/dist/utils/index.js
CHANGED
|
@@ -21,9 +21,11 @@ __exportStar(require("./generateBonusPreview"), exports);
|
|
|
21
21
|
__exportStar(require("./formatters"), exports);
|
|
22
22
|
__exportStar(require("./globalSettings"), exports);
|
|
23
23
|
__exportStar(require("./normalizeGlobalSettings"), exports);
|
|
24
|
+
__exportStar(require("./normalizeCasinoSettings"), exports);
|
|
24
25
|
__exportStar(require("./guildTimezone"), exports);
|
|
25
26
|
__exportStar(require("./generateId"), exports);
|
|
26
27
|
__exportStar(require("./parseTimeToSeconds"), exports);
|
|
27
28
|
__exportStar(require("./validateBetAmount"), exports);
|
|
28
29
|
__exportStar(require("./bonusStreak"), exports);
|
|
29
30
|
__exportStar(require("./validatePredictionBet"), exports);
|
|
31
|
+
__exportStar(require("./winAnnouncements"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeCasinoSettings = void 0;
|
|
4
|
+
const constants_1 = require("../constants");
|
|
5
|
+
const plinkoConfig_1 = require("../constants/plinkoConfig");
|
|
6
|
+
const isPlainObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
|
+
const deepMerge = (base, patch) => {
|
|
8
|
+
if (!patch)
|
|
9
|
+
return { ...base };
|
|
10
|
+
const result = { ...base };
|
|
11
|
+
for (const [key, patchValue] of Object.entries(patch)) {
|
|
12
|
+
const baseValue = base[key];
|
|
13
|
+
if (isPlainObject(baseValue) && isPlainObject(patchValue)) {
|
|
14
|
+
result[key] = deepMerge(baseValue, patchValue);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (patchValue !== undefined) {
|
|
18
|
+
result[key] = patchValue;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
const normalizeCasinoSettings = (settings) => {
|
|
24
|
+
const merged = deepMerge(constants_1.defaultCasinoSettings, settings);
|
|
25
|
+
return {
|
|
26
|
+
...merged,
|
|
27
|
+
plinko: {
|
|
28
|
+
...merged.plinko,
|
|
29
|
+
binMultipliers: (0, plinkoConfig_1.normalizePlinkoBinMultipliers)(merged.plinko.binMultipliers)
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
exports.normalizeCasinoSettings = normalizeCasinoSettings;
|
|
@@ -20,8 +20,7 @@ const normalizeCurrencySymbol = (value) => {
|
|
|
20
20
|
const normalizeCurrencyPlacement = (value) => value === 'suffix' ? 'suffix' : 'prefix';
|
|
21
21
|
const normalizeTimezone = (value) => {
|
|
22
22
|
const raw = typeof value === 'string' ? value.trim() : '';
|
|
23
|
-
if (raw.length > 0 &&
|
|
24
|
-
constants_1.COMMON_TIMEZONES.includes(raw)) {
|
|
23
|
+
if (raw.length > 0 && constants_1.COMMON_TIMEZONES.includes(raw)) {
|
|
25
24
|
return raw;
|
|
26
25
|
}
|
|
27
26
|
return constants_1.defaultGlobalSettings.timezone;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** minMultiplier <= 0 disables announcements for that game */
|
|
2
|
+
export declare const shouldAnnounceByMultiplier: (multiplier: number, minMultiplier: number) => boolean;
|
|
3
|
+
export declare const shouldAnnouncePlinkoBall: (multiplier: number, plinkoMinMultiplier: number) => boolean;
|
|
4
|
+
export declare const shouldAnnounceGoldenJackpotHit: (winMultiplier: number, goldenJackpotMinMultiplier: number) => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.shouldAnnounceGoldenJackpotHit = exports.shouldAnnouncePlinkoBall = exports.shouldAnnounceByMultiplier = void 0;
|
|
4
|
+
/** minMultiplier <= 0 disables announcements for that game */
|
|
5
|
+
const shouldAnnounceByMultiplier = (multiplier, minMultiplier) => minMultiplier > 0 && multiplier >= minMultiplier;
|
|
6
|
+
exports.shouldAnnounceByMultiplier = shouldAnnounceByMultiplier;
|
|
7
|
+
const shouldAnnouncePlinkoBall = (multiplier, plinkoMinMultiplier) => (0, exports.shouldAnnounceByMultiplier)(multiplier, plinkoMinMultiplier);
|
|
8
|
+
exports.shouldAnnouncePlinkoBall = shouldAnnouncePlinkoBall;
|
|
9
|
+
const shouldAnnounceGoldenJackpotHit = (winMultiplier, goldenJackpotMinMultiplier) => (0, exports.shouldAnnounceByMultiplier)(winMultiplier, goldenJackpotMinMultiplier);
|
|
10
|
+
exports.shouldAnnounceGoldenJackpotHit = shouldAnnounceGoldenJackpotHit;
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gambling-bot-shared",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.53",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "commonjs",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/krouskystepan/gambling-bot-shared.git"
|
|
11
|
+
},
|
|
8
12
|
"files": [
|
|
9
13
|
"dist"
|
|
10
14
|
],
|
|
@@ -25,25 +29,36 @@
|
|
|
25
29
|
"scripts": {
|
|
26
30
|
"build": "tsc -p tsconfig.json",
|
|
27
31
|
"dev": "tsc -p tsconfig.json --watch",
|
|
32
|
+
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
33
|
+
"format:fix": "prettier --write \"src/**/*.ts\"",
|
|
34
|
+
"lint:check": "eslint src --max-warnings 0",
|
|
35
|
+
"lint:fix": "eslint src --fix --max-warnings 0",
|
|
36
|
+
"type:check": "tsc --noEmit",
|
|
37
|
+
"check": "pnpm format:check && pnpm lint:check && pnpm type:check",
|
|
28
38
|
"prepublishOnly": "pnpm build",
|
|
29
39
|
"prepare": "bash scripts/setup-git-hooks.sh",
|
|
30
40
|
"link-local": "bash scripts/link-local.sh",
|
|
31
41
|
"unlink-local": "bash scripts/unlink-local.sh",
|
|
32
42
|
"link-status": "bash scripts/shared-link-status.sh",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"publish-to-npm": "bash scripts/publish-to-npm.sh"
|
|
43
|
+
"setup-workspace": "bash scripts/setup-workspace.sh",
|
|
44
|
+
"bump": "bash scripts/bump.sh"
|
|
36
45
|
},
|
|
37
46
|
"peerDependencies": {
|
|
38
47
|
"mongoose": "^9.0.0"
|
|
39
48
|
},
|
|
40
49
|
"devDependencies": {
|
|
50
|
+
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
41
51
|
"@types/luxon": "^3.7.1",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.59.4",
|
|
53
|
+
"@typescript-eslint/parser": "^8.59.4",
|
|
54
|
+
"eslint": "^10.4.0",
|
|
42
55
|
"mongoose": "^9.1.4",
|
|
56
|
+
"prettier": "^3.8.3",
|
|
43
57
|
"typescript": "^5.9.3"
|
|
44
58
|
},
|
|
45
59
|
"dependencies": {
|
|
46
60
|
"luxon": "^3.7.2",
|
|
47
61
|
"zod": "^4.3.6"
|
|
48
|
-
}
|
|
62
|
+
},
|
|
63
|
+
"packageManager": "pnpm@10.28.0"
|
|
49
64
|
}
|