mirror of
https://github.com/cassoule/flopobot_v2.git
synced 2026-01-18 16:37:40 +01:00
oyea
This commit is contained in:
@@ -254,7 +254,8 @@ export async function settleAll(room) {
|
||||
});
|
||||
allRes[p.id] = res;
|
||||
p.totalDelta += res.delta
|
||||
if (res.result === 'win' || res.result === 'push') {
|
||||
p.totalBets++
|
||||
if (res.result === 'win' || res.result === 'push' || res.result === 'blackjack') {
|
||||
const userDB = getUser.get(p.id);
|
||||
if (userDB) {
|
||||
const coins = userDB.coins;
|
||||
@@ -289,6 +290,11 @@ export async function settleAll(room) {
|
||||
value: `**${p.totalDelta >= 0 ? '+' + p.totalDelta : p.totalDelta}** Flopos`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `Mises jouées`,
|
||||
value: `**${p.totalBets}**`,
|
||||
inline: true
|
||||
}
|
||||
)
|
||||
.setColor(p.totalDelta >= 0 ? 0x22A55B : 0xED4245)
|
||||
.setTimestamp(new Date());
|
||||
|
||||
@@ -129,6 +129,7 @@ export function blackjackRoutes(io) {
|
||||
joined_at: Date.now(),
|
||||
msgId: null,
|
||||
totalDelta: 0,
|
||||
totalBets: 0,
|
||||
};
|
||||
|
||||
try {
|
||||
@@ -139,11 +140,16 @@ export function blackjackRoutes(io) {
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescription(`<@${userId}> joue au Blackjack`)
|
||||
.addFields(
|
||||
{
|
||||
name: `Gains`,
|
||||
value: `**${room.players[userId].totalDelta >= 0 ? '+' + room.players[userId].totalDelta : room.players[userId].totalDelta}** Flopos`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `Gains`,
|
||||
value: `**${room.players[userId].totalDelta >= 0 ? '+' + room.players[userId].totalDelta : room.players[userId].totalDelta}** Flopos`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `Mises jouées`,
|
||||
value: `**${room.players[userId].totalBets}**`,
|
||||
inline: true
|
||||
}
|
||||
)
|
||||
.setColor('#5865f2')
|
||||
.setTimestamp(new Date());
|
||||
@@ -176,6 +182,11 @@ export function blackjackRoutes(io) {
|
||||
value: `**${room.players[userId].totalDelta >= 0 ? '+' + room.players[userId].totalDelta : room.players[userId].totalDelta}** Flopos`,
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: `Mises jouées`,
|
||||
value: `**${room.players[userId].totalBets}**`,
|
||||
inline: true
|
||||
}
|
||||
)
|
||||
.setColor(room.players[userId].totalDelta >= 0 ? 0x22A55B : 0xED4245)
|
||||
.setTimestamp(new Date());
|
||||
|
||||
Reference in New Issue
Block a user