From d88c6be0ce52050a698a3ecbe3cf126c4fc718c1 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 28 May 2022 16:40:44 +0700 Subject: [PATCH] Check store error --- Bot/Games/Store.fs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index 40ad67e..68e703a 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -247,6 +247,7 @@ let handleBuyItem (dispatch : IDiscordContext -> Task) (ctx : IDiscordContext) i >>= checkDoesntExceedStackCap item |> handleResultWithResponse ctx (fun player -> async { let price = match item.Attributes with CanBuy price -> price | _ -> 0 + try do! dispatch ctx |> Async.AwaitTask do! DbService.updatePlayerCurrency -price player.DiscordId |> Async.Ignore do! DbService.addToPlayerInventory player.DiscordId item |> Async.Ignore @@ -273,6 +274,8 @@ let handleBuyItem (dispatch : IDiscordContext -> Task) (ctx : IDiscordContext) i |> Async.Ignore do! Analytics.buyItemButton (ctx.GetDiscordMember()) item.Id price + with ex -> + printfn $"STORE ERROR: {ex.Message}" }) })