From d311423ca22b45ee74ec647a8f2587faa6d77a80 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Wed, 9 Feb 2022 22:36:13 +0700 Subject: [PATCH] Fix bug with excessive hacks reaching embed limit. Fuck it mention users --- Bot/Embeds.fs | 6 +----- Bot/Store.fs | 5 ++++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 2e77b1e..1315cfb 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -99,11 +99,7 @@ let responseCreatedShieldTrainer (shield : BattleItem) = let eventSuccessfulHack (event : ComponentInteractionCreateEventArgs) target prize = DiscordMessageBuilder() - .WithContent($"{event.User.Username} successfully hacked {target.Name} for a total of {prize} GoodBoyTokenz") - -let eventFailedHack (event : ComponentInteractionCreateEventArgs) target prize = - DiscordMessageBuilder() - .WithContent($"{event.User.Username} successfully hacked {target.Name} for a total of {prize} GoodBoyTokenz") + .WithContent($"{event.User.Username} successfully hacked <@{target.DiscordId}> for a total of {prize} GoodBoyTokenz") let getGoodAgainst = function | BattleClass.Network -> ( ShieldId.Firewall , HackId.Virus ) diff --git a/Bot/Store.fs b/Bot/Store.fs index 154595a..d0bf9c5 100644 --- a/Bot/Store.fs +++ b/Bot/Store.fs @@ -38,7 +38,10 @@ let actionFormat (actions : Action array) = match actions with | [||] -> "None" | _ -> - actions + let hacks , defenses = actions |> Array.partition (fun act -> match act.Type with Attack _ -> true | Defense -> false) + let hacks = hacks |> Array.take (min hacks.Length 10) + hacks + |> Array.append defenses |> Array.map (fun act -> let item = Armory.getItem act.ActionId match act.Type with