From d47eb1a3ca58ed93a7c679c91279a7a7a719fd34 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 29 Apr 2022 11:39:18 +0700 Subject: [PATCH] WIP metadata --- Bot/DbService.fs | 7 ++++--- Bot/GameTypes.fs | 1 + Bot/Games/Store.fs | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Bot/DbService.fs b/Bot/DbService.fs index 6295aad..c82327d 100644 --- a/Bot/DbService.fs +++ b/Bot/DbService.fs @@ -23,6 +23,7 @@ let readItem (reader : RowReader) = { TargetStat = stat ; Effect = fx } { Item.Id = reader.int "id" Item.Name = reader.string "name" + Item.Description = reader.string "description" Item.IconUrl = reader.string "icon" Item.Symbol = reader.string "symbol" Item.Type = @@ -56,7 +57,7 @@ let getPlayerInventory (did : uint64) = |> Sql.connect |> Sql.parameters [ "did", Sql.string (string did) ] |> Sql.query """ - SELECT ii.id,ii.symbol,name,icon,category,buy_price,sell_price,rate_limit,expiration,drop_chance,can_trade,can_consume, + SELECT ii.id,ii.symbol,name,description,icon,category,buy_price,sell_price,rate_limit,expiration,drop_chance,can_trade,can_consume, attack_power,defense_power,class_name,max_stack,mods FROM inventory_item JOIN item ii on inventory_item.item_id = ii.id @@ -92,7 +93,7 @@ let getStoreItems (channelId : uint64) = |> Sql.connect |> Sql.parameters [ "cid", Sql.string (string channelId) ] |> Sql.query """ - SELECT i.id,i.symbol,name,icon,category,buy_price,sell_price,rate_limit,expiration,drop_chance,can_trade,can_consume, + SELECT i.id,i.symbol,name,description,icon,category,buy_price,sell_price,rate_limit,expiration,drop_chance,can_trade,can_consume, attack_power,defense_power,class_name,max_stack,mods FROM store_item JOIN store st on store_item.store_id = st.id @@ -106,7 +107,7 @@ let getWeapons () = connStr |> Sql.connect |> Sql.query """ - SELECT i.id,i.symbol,name,icon,category,buy_price,sell_price,rate_limit,expiration,drop_chance,can_trade,can_consume, + SELECT i.id,i.symbol,name,description,icon,category,buy_price,sell_price,rate_limit,expiration,drop_chance,can_trade,can_consume, attack_power,defense_power,class_name,max_stack,mods FROM item WHERE category = 'Hack' OR symbol = 'Shield' """ diff --git a/Bot/GameTypes.fs b/Bot/GameTypes.fs index 6feb097..8b8e73b 100644 --- a/Bot/GameTypes.fs +++ b/Bot/GameTypes.fs @@ -132,6 +132,7 @@ let (|CanStack|_|) itemAttrs = itemAttrs |> List.tryPick (function Stackable type Item = { Id : int Name : string + Description : string Type : ItemType Symbol : string IconUrl : string diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index 9e2d621..1516be9 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -162,8 +162,9 @@ let purchaseItemEmbed (item : Item) = embed.Title <- $"Purchased {item.Name}" match item.Type with | ItemType.Jpeg -> - if item.Symbol = "RAFFLE" then + if item.Symbol.Contains "RAFFLE" then embed.Description <- $"Congratulations! You are in the draw for the {item.Name}. The winner will be announced shortly" + embed.ImageUrl <- item.Description else embed.Description <- $"Congratulations! You own the rights to the {item.Name} NFT. Please create a ticket in the support channel and we will transfer to your wallet" | _ -> embed.Description <- $"Purchased {item.Name}"