From 58ffe0c2f87729e944cfad1856e05edf5c9dd135 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Tue, 24 May 2022 17:19:48 +0700 Subject: [PATCH] Boolean logic --- Bot/Games/Store.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index ba9fb11..40ad67e 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -130,11 +130,11 @@ let getBuyItemsEmbed storeId player (storeInventory : StoreItem list) = let owned = player.Inventory |> List.exists (fun i -> i.Id = item.Item.Id) let inStock = item.Available && (item.Stock > 0 || item.LimitStock = false) match owned , inStock with - | false , true -> DiscordButtonComponent(WeaponClass.getClassButtonColor item.Item, $"Buy-{item.Item.Id}-{storeId}", $"Buy {item.Item.Name}") - | false , false -> + | _ , false -> let msg = if item.Available then "Out of Stock" else "Unavailable" DiscordButtonComponent(WeaponClass.getClassButtonColor item.Item, $"Buy-{item.Item.Id}-{storeId}", $"{item.Item.Name} ({msg})", true) - | true , _ -> + | false , true -> DiscordButtonComponent(WeaponClass.getClassButtonColor item.Item, $"Buy-{item.Item.Id}-{storeId}", $"Buy {item.Item.Name}") + | _ -> match checkDoesntExceedStackCap item.Item player with | Ok _ -> DiscordButtonComponent(WeaponClass.getClassButtonColor item.Item, $"Buy-{item.Item.Id}-{storeId}", $"Buy {item.Item.Name}") | Error _ -> DiscordButtonComponent(WeaponClass.getClassButtonColor item.Item, $"Buy-{item.Item.Id}-{storeId}", $"Own {item.Item.Name}", true)