This commit is contained in:
Joseph Ferano 2022-05-06 19:06:26 +07:00
parent a4b0834047
commit faa45a49f7
2 changed files with 5 additions and 5 deletions

View File

@ -302,7 +302,7 @@ let updatePlayerCurrency (addAmount : int<GBT>) (did : uint64) =
"did", Sql.string (string did) "did", Sql.string (string did)
"gbt", Sql.int (int addAmount) "gbt", Sql.int (int addAmount)
] |> Sql.query """ ] |> Sql.query """
UPDATE "user" SET gbt = gbt + GREATEST(gbt + @gbt, 0) WHERE discord_id = @did; UPDATE "user" SET gbt = GREATEST(gbt + @gbt, 0) WHERE discord_id = @did;
""" """
|> Sql.executeNonQueryAsync |> Sql.executeNonQueryAsync
|> Async.AwaitTask |> Async.AwaitTask

View File

@ -270,11 +270,11 @@ let spin multiplier (ctx : IDiscordContext) =
embed.Color <- DiscordColor.Green embed.Color <- DiscordColor.Green
embed.Description <- $"🎉🎉 YOU HIT THE JACKPOT 🎉🎉" embed.Description <- $"🎉🎉 YOU HIT THE JACKPOT 🎉🎉"
embed.AddField("Bet", $"{playAmount}", true) |> ignore embed.AddField("Bet", $"{playAmount}", true) |> ignore
embed.AddField("Prize", $"{jackpot}", true) |> ignore embed.AddField("Prize", $"{jackpot.Stock}", true) |> ignore
addGBTField embed (Inventory.getBuyPrice jackpot.Item) addGBTField embed (jackpot.Stock * 1<GBT>)
do! DbService.updatePlayerCurrency (Inventory.getBuyPrice jackpot.Item) player.DiscordId |> Async.Ignore do! DbService.updatePlayerCurrency (jackpot.Stock * 1<GBT>) player.DiscordId |> Async.Ignore
do! DbService.setItemStock BaseJackpotAmount "JACKPOT" |> Async.Ignore do! DbService.setItemStock BaseJackpotAmount "JACKPOT" |> Async.Ignore
return "JACKPOT" , Inventory.getBuyPrice jackpot.Item return "JACKPOT" , jackpot.Stock * 1<GBT>
| None -> | None ->
do! DbService.incrementItemStock 1<GBT> "JACKPOT" |> Async.Ignore do! DbService.incrementItemStock 1<GBT> "JACKPOT" |> Async.Ignore
embed.Description <- $"You LOST `💰` **{playAmount}** $GBT 😭" embed.Description <- $"You LOST `💰` **{playAmount}** $GBT 😭"