From ef308bd3f57ff78fc7e0c68396f8c494f11a0811 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Mon, 28 Mar 2022 12:38:41 +0700 Subject: [PATCH] Check if they're not a hacker, further spacing --- Bot/InviteTracker.fs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index b17fed3..83425b1 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -335,6 +335,7 @@ Your NFT will be your In-Game Character that provides you with unique traits, an type WhitelistResult = | NotInGame + | NotAHacker | NotEnoughGBT of currentAmount : int | Granted of PlayerData | AlreadyWhitelisted @@ -348,10 +349,14 @@ let tryGrantWhitelist (ctx : IDiscordContext) = if Seq.contains role user.Roles then return AlreadyWhitelisted elif player.Active then - if int player.Bank >= WhitelistPrice then - return Granted player + let hackerRole = ctx.GetGuild().GetRole(GuildEnvironment.roleHacker) + if Seq.contains hackerRole user.Roles then + if int player.Bank >= WhitelistPrice then + return Granted player + else + return NotEnoughGBT (int player.Bank) else - return NotEnoughGBT (int player.Bank) + return NotAHacker else return NotInGame | None -> return NotInGame @@ -366,12 +371,20 @@ let handleGimmeWhitelist (ctx : IDiscordContext) = let thumb = DiscordEmbedBuilder.EmbedThumbnail() thumb.Url <- "https://s7.gifyu.com/images/Card-5x-rotate.png" whitelistEmbed.Thumbnail <- thumb - whitelistEmbed.Title <- "1x Degenz Game Whitelist ‎" + whitelistEmbed.Title <- "1x Degenz Game Whitelist ‎" whitelistEmbed.AddField("Mint April 2022", "Join us on the moon", true) |> ignore whitelistEmbed.AddField("Price 💰", $"{WhitelistPrice} $GBT", true) |> ignore let builder = DiscordFollowupMessageBuilder().AsEphemeral(true) match! tryGrantWhitelist ctx with + | NotAHacker -> + builder.Content <- $""" +Woah slow down buddy… You’re not even a hacker yet! + +To get Whitelisted you need to buy it with **$GBT** by playing the game. + +Go to <#{GuildEnvironment.channelTraining}> NOW to finish training and become a **HACKER**!** +""" | NotInGame -> builder.Content <- $""" Woah slow down buddy… You’re not even in the game yet! @@ -405,8 +418,7 @@ Oh no! You don't have enough **$GBT** to buy a WHITELIST spot! Come back when you have `{WhitelistPrice - total}` more $GBT. -The quickest way to earn $GBT is to `/recruit`. You'll earn `{InviteRewardAmount} 💰 $GBT` -for every Degen you `/recruit`! +The quickest way to earn $GBT is to `/recruit`. You'll earn `{InviteRewardAmount} 💰 $GBT` for every Degen you `/recruit`! """ builder.AddComponents([ buyBtn ; recruitBtn ]) |> ignore builder.AddEmbed(msgEmbed) |> ignore @@ -418,9 +430,7 @@ for every Degen you `/recruit`! msgEmbed.Title <- "Buy Whitelist" msgEmbed.Color <- DiscordColor.Green msgEmbed.Description <- $""" -Look at you Degen, you played Big Brother’s games and made it out alive! - -Now you can use your $GBT to pay for one of our coveted Whitelist spots. +Look at you Degen, you played Big Brother’s games and made it out alive! Now you can use your $GBT to pay for one of our coveted Whitelist spots. Click buy now below and the role will be auto assigned to you. """ @@ -436,6 +446,7 @@ let handleBuyWhitelist (ctx : IDiscordContext) = let builder = DiscordFollowupMessageBuilder().AsEphemeral(true) match! tryGrantWhitelist ctx with + | NotAHacker -> builder.Content <- $"You are somehow not a hacker anymore, what exactly are you doing?" | NotInGame -> builder.Content <- $"You somehow have left the game, what exactly are you doing?" | AlreadyWhitelisted -> builder.Content <- $"""