From bf7e5d08bf87797200c002662eb5b0b2c7444ad0 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Wed, 20 Apr 2022 13:26:29 +0700 Subject: [PATCH] Change buttons --- Bot/Games/SlotMachine.fs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Bot/Games/SlotMachine.fs b/Bot/Games/SlotMachine.fs index 195f175..c1de4d5 100644 --- a/Bot/Games/SlotMachine.fs +++ b/Bot/Games/SlotMachine.fs @@ -136,15 +136,6 @@ let sleepTime = 1500 let mutable guildEmojis : Map option = None let mutable anyEmoji : DiscordEmoji option = None -let embedButtons includePrizeTable = - let button1 = DiscordButtonComponent(ButtonStyle.Success, $"spin-1x", $"Bet 1x - {PlayPricex1} $GBT") :> DiscordComponent - let button2 = DiscordButtonComponent(ButtonStyle.Success, $"spin-2x", $"Bet 2x - {PlayPricex2} $GBT") :> DiscordComponent - let button3 = DiscordButtonComponent(ButtonStyle.Success, $"spin-3x", $"Bet 3x - {PlayPricex3} $GBT") :> DiscordComponent - let button4 = DiscordButtonComponent(ButtonStyle.Primary, $"prizes", $"Show Prizes") :> DiscordComponent - if includePrizeTable - then [| button1 ; button2 ; button3 ; button4 |] - else [| button1 ; button2 ; button3 |] - let getJackpotAmount () = GuildEnvironment.connectionString |> Sql.connect @@ -294,7 +285,11 @@ let spin multiplier (ctx : IDiscordContext) = return "LOST" , 0 } let dwb = DiscordWebhookBuilder() - dwb.AddComponents(embedButtons false).AddEmbed(embed).WithContent(slotsContent) |> ignore + let betText mult = if mult = multiplier then "Spin Again" else "Bet" + let button1 = DiscordButtonComponent(ButtonStyle.Success, $"spin-1x", $"{betText 1} {PlayPricex1} $GBT 🎰") :> DiscordComponent + let button2 = DiscordButtonComponent(ButtonStyle.Success, $"spin-2x", $"{betText 2} {PlayPricex2} $GBT 🎰") :> DiscordComponent + let button3 = DiscordButtonComponent(ButtonStyle.Success, $"spin-3x", $"{betText 3} {PlayPricex3} $GBT 🎰") :> DiscordComponent + dwb.AddComponents([| button1 ; button2 ; button3 |]).AddEmbed(embed).WithContent(slotsContent) |> ignore do! itx.EditFollowupMessageAsync(followUpMessage.Id, dwb) |> Async.AwaitTask |> Async.Ignore do! Analytics.slotPlayed (ctx.GetDiscordMember()) playAmount result prizeAmount } @@ -345,7 +340,11 @@ let sendInitialEmbed (ctx : IDiscordContext) = builder.AddEmbed(embed) |> ignore - builder.AddComponents(embedButtons true) |> ignore + let button1 = DiscordButtonComponent(ButtonStyle.Success, $"spin-1x", $"Bet 1x - {PlayPricex1} $GBT 🎰") :> DiscordComponent + let button2 = DiscordButtonComponent(ButtonStyle.Success, $"spin-2x", $"Bet 2x - {PlayPricex2} $GBT 🎰") :> DiscordComponent + let button3 = DiscordButtonComponent(ButtonStyle.Success, $"spin-3x", $"Bet 3x - {PlayPricex3} $GBT 🎰") :> DiscordComponent + let button4 = DiscordButtonComponent(ButtonStyle.Primary, $"prizes", $"Show Prizes") :> DiscordComponent + builder.AddComponents([| button1 ; button2 ; button3 ; button4 |]) |> ignore do! GuildEnvironment.botClientSlots.Value.SendMessageAsync(channel, builder) |> Async.AwaitTask |> Async.Ignore