From 03010e51baf3b85f7af2b0fa3deef4382d2e933c Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 29 May 2022 16:28:21 +0700 Subject: [PATCH 01/25] Print debugging --- Bot/InviteTracker.fs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 0e9e26d..36f588f 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -452,10 +452,14 @@ let handleMemberUpdated (client : DiscordClient) (event : GuildMemberUpdateEvent let handleMessageCreated _ (event : MessageCreateEventArgs) = task { - let bot = GuildEnvironment.botClientRecruit.Value + let bot = GuildEnvironment.botClientRecruit.Value + printfn $"{event.Channel.Id} - {GuildEnvironment.channelSubmitWallet}" + printfn $"{event.Author.Id} - {bot.CurrentUser.Id}" if event.Channel.Id = GuildEnvironment.channelSubmitWallet && event.Author.Id <> bot.CurrentUser.Id then do! Async.Sleep 100 + printfn "Going to delete" do! event.Message.DeleteAsync() + printfn "Able to?" } :> Task let handleGuildMemberAdded _ (eventArgs : GuildMemberAddEventArgs) = From 517cf46b1aa0cefa5091d7825f468ef920fe4ac8 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 29 May 2022 16:45:54 +0700 Subject: [PATCH 02/25] Confused --- Bot/InviteTracker.fs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 36f588f..9967c7a 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -453,8 +453,7 @@ let handleMemberUpdated (client : DiscordClient) (event : GuildMemberUpdateEvent let handleMessageCreated _ (event : MessageCreateEventArgs) = task { let bot = GuildEnvironment.botClientRecruit.Value - printfn $"{event.Channel.Id} - {GuildEnvironment.channelSubmitWallet}" - printfn $"{event.Author.Id} - {bot.CurrentUser.Id}" + printfn $"What channel is it? {event.Channel.Id} - {GuildEnvironment.channelSubmitWallet} ||| Who done it? {event.Author.Id} - {bot.CurrentUser.Id}" if event.Channel.Id = GuildEnvironment.channelSubmitWallet && event.Author.Id <> bot.CurrentUser.Id then do! Async.Sleep 100 printfn "Going to delete" From 773f1c36c8f4f870b0029f1e48657780f3b06e28 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 29 May 2022 16:55:32 +0700 Subject: [PATCH 03/25] try --- Bot/InviteTracker.fs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 9967c7a..12cebf7 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -453,12 +453,11 @@ let handleMemberUpdated (client : DiscordClient) (event : GuildMemberUpdateEvent let handleMessageCreated _ (event : MessageCreateEventArgs) = task { let bot = GuildEnvironment.botClientRecruit.Value - printfn $"What channel is it? {event.Channel.Id} - {GuildEnvironment.channelSubmitWallet} ||| Who done it? {event.Author.Id} - {bot.CurrentUser.Id}" if event.Channel.Id = GuildEnvironment.channelSubmitWallet && event.Author.Id <> bot.CurrentUser.Id then do! Async.Sleep 100 - printfn "Going to delete" + try do! event.Message.DeleteAsync() - printfn "Able to?" + with ex -> printfn $"HERE? {ex.Message}" } :> Task let handleGuildMemberAdded _ (eventArgs : GuildMemberAddEventArgs) = From 1b28d5885cbc5bbc228480bf371b5e97ea2f0d94 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 29 May 2022 17:07:18 +0700 Subject: [PATCH 04/25] Not sure what else to do --- Bot/InviteTracker.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 12cebf7..e44c88a 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -453,11 +453,11 @@ let handleMemberUpdated (client : DiscordClient) (event : GuildMemberUpdateEvent let handleMessageCreated _ (event : MessageCreateEventArgs) = task { let bot = GuildEnvironment.botClientRecruit.Value + if event.Channel.Id = GuildEnvironment.channelSubmitWallet then + printfn $"{event.Author.Id} - {bot.CurrentUser.Id}" if event.Channel.Id = GuildEnvironment.channelSubmitWallet && event.Author.Id <> bot.CurrentUser.Id then do! Async.Sleep 100 - try do! event.Message.DeleteAsync() - with ex -> printfn $"HERE? {ex.Message}" } :> Task let handleGuildMemberAdded _ (eventArgs : GuildMemberAddEventArgs) = From 6dcf294659bf5b618f6aced08ac7ed3a5089b662 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 29 May 2022 17:18:33 +0700 Subject: [PATCH 05/25] Remove log --- Bot/InviteTracker.fs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index e44c88a..edd75d1 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -453,8 +453,6 @@ let handleMemberUpdated (client : DiscordClient) (event : GuildMemberUpdateEvent let handleMessageCreated _ (event : MessageCreateEventArgs) = task { let bot = GuildEnvironment.botClientRecruit.Value - if event.Channel.Id = GuildEnvironment.channelSubmitWallet then - printfn $"{event.Author.Id} - {bot.CurrentUser.Id}" if event.Channel.Id = GuildEnvironment.channelSubmitWallet && event.Author.Id <> bot.CurrentUser.Id then do! Async.Sleep 100 do! event.Message.DeleteAsync() From bd3fde001f47b8d861cd6ed3441c5dfbf1828748 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 29 May 2022 17:48:18 +0700 Subject: [PATCH 06/25] remove print --- Bot/InviteTracker.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index edd75d1..9895daf 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -508,7 +508,6 @@ Keep an eye on <#{GuildEnvironment.channelAnnouncements}> for updates.""" do! Messaging.sendFollowUpMessage ctx "⚠️ That's not a valid Solana address, please try again" do! Analytics.invalidWalletSubmit (ctx.GetDiscordMember()) with ex -> - printfn $"{ex.Message}" do! Messaging.sendFollowUpMessage ctx "⚠️ That's not a valid Solana address, please try again" do! Analytics.invalidWalletSubmit (ctx.GetDiscordMember()) }) From 0f82354f8e38055cfa3596ac6e2520df712843f0 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 2 Jun 2022 23:08:14 +0700 Subject: [PATCH 07/25] Copy changes --- Bot/Embeds.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 7e8011b..9af533f 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -67,10 +67,10 @@ let pickHack actionId attacker defender bonus isTrainer = {defender.Name} has **{defender.Bank} $GBT** we can take from them. **__Your Strength:__** - 💪 {attacker.Stats.Strength.Amount} + `💪 {attacker.Stats.Strength.Amount}` **__Their Strength:__** - 💪 {defender.Stats.Strength.Amount} + `💪 {defender.Stats.Strength.Amount}` {outcomeMsg}{bonusMsg}""" else "" let embed = @@ -81,7 +81,7 @@ let pickHack actionId attacker defender bonus isTrainer = if not isTrainer then for hack in Inventory.getHacks attacker.Inventory do let amount = if hack.Power > int defender.Bank then int defender.Bank else hack.Power - embed.AddField(hack.Name, $"Cooldown {hack.Cooldown} mins\nExtract {amount} $GBT", true) |> ignore + embed.AddField(hack.Name, $"Cooldown: {hack.Cooldown} mins\nSteal Total: `{amount + bonus} $GBT`", true) |> ignore DiscordFollowupMessageBuilder() .AddComponents(buttons) From 14af51c25e0ba2b52aa4b120b943110ad52ae5c5 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 2 Jun 2022 23:15:59 +0700 Subject: [PATCH 08/25] More --- Bot/Embeds.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 9af533f..01d4d5f 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -58,13 +58,13 @@ let pickHack actionId attacker defender bonus isTrainer = let ( outcomeMsg , bonusMsg ) = if attacker.Stats.Strength.Amount > defender.Stats.Strength.Amount then - "\nYou're stronger so you'll steal more!!!\n" , $"\n**__Potential Bonus:__**\n{bonus} 💰$GBT" + "\nYou're stronger so you'll steal more!!!\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" else "\nYou're not stronger than them, you need to eat more!" , "" let stealMsg = if not isTrainer then $""" - {defender.Name} has **{defender.Bank} $GBT** we can take from them. + **{defender.Name}** has `{defender.Bank} $GBT`` we can take from them. **__Your Strength:__** `💪 {attacker.Stats.Strength.Amount}` From 5166511044341b7dda82af7b87be78bb047a18b5 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 2 Jun 2022 23:25:03 +0700 Subject: [PATCH 09/25] Ugh --- Bot/Embeds.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 01d4d5f..b633624 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -64,7 +64,7 @@ let pickHack actionId attacker defender bonus isTrainer = let stealMsg = if not isTrainer then $""" - **{defender.Name}** has `{defender.Bank} $GBT`` we can take from them. + **{defender.Name}** has `{defender.Bank} $GBT` we can take from them. **__Your Strength:__** `💪 {attacker.Stats.Strength.Amount}` From 56d253bab809fdc71eed4012d6e5601f502d8dc7 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Thu, 2 Jun 2022 23:53:55 +0700 Subject: [PATCH 10/25] Add emojis --- Bot/Embeds.fs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index b633624..afaad8f 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -1,6 +1,7 @@ module Degenz.Embeds open System +open DSharpPlus open Degenz open Degenz.Messaging open DSharpPlus.Entities @@ -42,7 +43,13 @@ let pickDefense actionId player isTrainer = for shield in Inventory.getShields player.Inventory do let hours = TimeSpan.FromMinutes(int shield.Cooldown).TotalHours |> int let against = WeaponClass.getGoodAgainst shield.Class |> snd - embed.AddField(shield.Name, $"Active {hours} hours\nDefeats {against}", true) |> ignore + let emoji = + match shield.Id with + | "FIREWALL" -> "<:firewall_shield:971620988649340989>" + | "ENCRYPTION" -> "<:encryption_shield:971620979912605727>" + | "CYPHER" -> "<:cypher_shield:971620965576503326>" + | _ -> "" + embed.AddField($"{emoji} {shield.Name}", $"Active {hours} hours\nDefeats {against}", true) |> ignore DiscordFollowupMessageBuilder() .AddComponents(buttons) @@ -81,7 +88,13 @@ let pickHack actionId attacker defender bonus isTrainer = if not isTrainer then for hack in Inventory.getHacks attacker.Inventory do let amount = if hack.Power > int defender.Bank then int defender.Bank else hack.Power - embed.AddField(hack.Name, $"Cooldown: {hack.Cooldown} mins\nSteal Total: `{amount + bonus} $GBT`", true) |> ignore + let emoji = + match hack.Id with + | "REMOTE" -> "<:remote_access:971621009981571132>" + | "VIRUS" -> "<:virus_hack:971636840580927510>" + | "WORM" -> "<:worm_hack:971636842640310312>" + | _ -> "" + embed.AddField($"{emoji} {hack.Name}", $"Cooldown: {hack.Cooldown} mins\nSteal Total: `{amount + bonus} $GBT`", true) |> ignore DiscordFollowupMessageBuilder() .AddComponents(buttons) From a80d31b40c1d9c05fd6243f08e3daa1a2146120c Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 00:04:13 +0700 Subject: [PATCH 11/25] More info --- Bot/Embeds.fs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index afaad8f..2f298b9 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -65,7 +65,7 @@ let pickHack actionId attacker defender bonus isTrainer = let ( outcomeMsg , bonusMsg ) = if attacker.Stats.Strength.Amount > defender.Stats.Strength.Amount then - "\nYou're stronger so you'll steal more!!!\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" + "\nYou're stronger so you'll hack more!!!\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" else "\nYou're not stronger than them, you need to eat more!" , "" let stealMsg = @@ -94,7 +94,12 @@ let pickHack actionId attacker defender bonus isTrainer = | "VIRUS" -> "<:virus_hack:971636840580927510>" | "WORM" -> "<:worm_hack:971636842640310312>" | _ -> "" - embed.AddField($"{emoji} {hack.Name}", $"Cooldown: {hack.Cooldown} mins\nSteal Total: `{amount + bonus} $GBT`", true) |> ignore + let fieldMsg = $""" + **Cooldown:** {hack.Cooldown} mins + **Hack Base:** {hack.Power} + **Strength Bonus:** {bonus} + **Hack Total:** {amount + bonus} $GBT""" + embed.AddField($"{emoji} {hack.Name}", fieldMsg, true) |> ignore DiscordFollowupMessageBuilder() .AddComponents(buttons) From 1ff6a4dc28c8ddc7aa06d21df3288fda3b09ab02 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 00:24:56 +0700 Subject: [PATCH 12/25] Assorted fixes --- Bot/Embeds.fs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 2f298b9..61be815 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -11,6 +11,7 @@ let shieldGif = "https://s10.gifyu.com/images/Defense-Degenz-V2-min.gif" let constructButtons (actionId: string) (buttonInfo : string) (player: PlayerData) (items : Inventory) ignoreCooldown = items + |> List.sortBy (fun item -> item.Id) |> List.map (fun item -> let action = player.Events @@ -71,7 +72,7 @@ let pickHack actionId attacker defender bonus isTrainer = let stealMsg = if not isTrainer then $""" - **{defender.Name}** has `{defender.Bank} $GBT` we can take from them. + **{defender.Name}** has `{defender.Bank} 💰$GBT` we can take from them. **__Your Strength:__** `💪 {attacker.Stats.Strength.Amount}` @@ -86,7 +87,8 @@ let pickHack actionId attacker defender bonus isTrainer = .WithDescription($"{stealMsg}\n\nPick the hack you want to use.") if not isTrainer then - for hack in Inventory.getHacks attacker.Inventory do + let hacks = Inventory.getHacks attacker.Inventory |> List.sortBy (fun h -> h.Id) + for hack in hacks do let amount = if hack.Power > int defender.Bank then int defender.Bank else hack.Power let emoji = match hack.Id with @@ -95,11 +97,10 @@ let pickHack actionId attacker defender bonus isTrainer = | "WORM" -> "<:worm_hack:971636842640310312>" | _ -> "" let fieldMsg = $""" - **Cooldown:** {hack.Cooldown} mins - **Hack Base:** {hack.Power} - **Strength Bonus:** {bonus} - **Hack Total:** {amount + bonus} $GBT""" - embed.AddField($"{emoji} {hack.Name}", fieldMsg, true) |> ignore + Hack Base: `{hack.Power} 💰$GBT` + Bonus: `{bonus} 💰$GBT` + **Hack Total:** `{amount + bonus} 💰$GBT`""" + embed.AddField($"{emoji} __{hack.Name}__", fieldMsg, true) |> ignore DiscordFollowupMessageBuilder() .AddComponents(buttons) From a457382482d78214244426aab02334662c991067 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 00:28:39 +0700 Subject: [PATCH 13/25] Boldify --- Bot/Embeds.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 61be815..be75379 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -66,9 +66,9 @@ let pickHack actionId attacker defender bonus isTrainer = let ( outcomeMsg , bonusMsg ) = if attacker.Stats.Strength.Amount > defender.Stats.Strength.Amount then - "\nYou're stronger so you'll hack more!!!\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" + "\nYou're **STRONGER** so you'll **HACK MORE!!!**\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" else - "\nYou're not stronger than them, you need to eat more!" , "" + "\nYou're **NOT STRONGER** than them, you need to **EAT MORE!**" , "" let stealMsg = if not isTrainer then $""" From 4fe82b9095dd48ede148d5c3c44f482bd1f75c14 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 00:30:26 +0700 Subject: [PATCH 14/25] Ticks --- Bot/Embeds.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index be75379..c01612b 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -66,7 +66,7 @@ let pickHack actionId attacker defender bonus isTrainer = let ( outcomeMsg , bonusMsg ) = if attacker.Stats.Strength.Amount > defender.Stats.Strength.Amount then - "\nYou're **STRONGER** so you'll **HACK MORE!!!**\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" + "\nYou're **STRONGER** so you'll **HACK MORE!!!** `💰$GBT`\n" , $"\n**__Potential Bonus:__**\n`{bonus} 💰$GBT`" else "\nYou're **NOT STRONGER** than them, you need to **EAT MORE!**" , "" let stealMsg = From ba7b98d86fcadfaeba17b6b411af8f3f7497eb0c Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 17:28:34 +0700 Subject: [PATCH 15/25] Change mint date --- Bot/InviteTracker.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 9895daf..a1887bb 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -355,7 +355,7 @@ let showWalletStatus (ctx : IDiscordContext) = try match! getWalletAddress player.DiscordId with | Some address -> do! Messaging.sendFollowUpMessage ctx $""" -🚀 __Mint Date:__ 31st May, 18:00 UTC +🚀 __Mint Date:__ Mid June ✅ __Status:__ We have successfully received your wallet address: {address}""" | None -> do! Messaging.sendFollowUpMessage ctx "You have no submitted your wallet yet. Type `/submit`, paste your **Solana Wallet Address**, then press enter" with ex -> @@ -492,7 +492,7 @@ let submitAddress (address : string) (ctx : IDiscordContext) = do! Messaging.sendFollowUpMessage ctx $""" -🚀 __Mint Date:__ 31st May 18:00 UTC +🚀 __Mint Date:__ Mid June ✅ {msg} {address} Keep an eye on <#{GuildEnvironment.channelAnnouncements}> for updates.""" From fc7fa6bd8277631cd79c98268c0af1359975c4c1 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 22:36:25 +0700 Subject: [PATCH 16/25] Mention thing and show name --- Bot/Embeds.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index c01612b..e63373c 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -140,7 +140,8 @@ let responseCreatedShield (shield : ShieldItem) = let eventSuccessfulHack (ctx : IDiscordContext) target prize = DiscordMessageBuilder() - .WithContent($"{ctx.GetDiscordMember().Username} successfully hacked <@{target.DiscordId}> and took {prize} GoodBoyTokenz") + .WithAllowedMention(UserMention(target.DiscordId)) + .WithContent($"{ctx.GetDiscordMember().Username} successfully hacked {target.Name} and took {prize} GoodBoyTokenz") let getArsenalEmbed (player : PlayerData) = DiscordFollowupMessageBuilder() From a1dd477623c77595ed340fcab415bc72e142fc55 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 22:50:35 +0700 Subject: [PATCH 17/25] Try this --- Bot/Embeds.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index e63373c..08a93f4 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -141,7 +141,7 @@ let responseCreatedShield (shield : ShieldItem) = let eventSuccessfulHack (ctx : IDiscordContext) target prize = DiscordMessageBuilder() .WithAllowedMention(UserMention(target.DiscordId)) - .WithContent($"{ctx.GetDiscordMember().Username} successfully hacked {target.Name} and took {prize} GoodBoyTokenz") + .WithContent($"<@{ctx.GetDiscordMember().Id}> - {ctx.GetDiscordMember().Username} successfully hacked {target.Name} and took {prize} $GBT!") let getArsenalEmbed (player : PlayerData) = DiscordFollowupMessageBuilder() From 802f7c0d4fc080e93291c31e5cae935c9d914547 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 22:58:23 +0700 Subject: [PATCH 18/25] wat dis do --- Bot/Embeds.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 08a93f4..5153c4b 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -141,7 +141,7 @@ let responseCreatedShield (shield : ShieldItem) = let eventSuccessfulHack (ctx : IDiscordContext) target prize = DiscordMessageBuilder() .WithAllowedMention(UserMention(target.DiscordId)) - .WithContent($"<@{ctx.GetDiscordMember().Id}> - {ctx.GetDiscordMember().Username} successfully hacked {target.Name} and took {prize} $GBT!") + .WithContent($"<@!{target.DiscordId}> - {ctx.GetDiscordMember().Username} successfully hacked {target.Name} and took {prize} $GBT!") let getArsenalEmbed (player : PlayerData) = DiscordFollowupMessageBuilder() From ccbb50bce736215e7bee3a1558da5a486b85efa6 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 22:59:31 +0700 Subject: [PATCH 19/25] Bold --- Bot/Embeds.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 5153c4b..05a3931 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -141,7 +141,7 @@ let responseCreatedShield (shield : ShieldItem) = let eventSuccessfulHack (ctx : IDiscordContext) target prize = DiscordMessageBuilder() .WithAllowedMention(UserMention(target.DiscordId)) - .WithContent($"<@!{target.DiscordId}> - {ctx.GetDiscordMember().Username} successfully hacked {target.Name} and took {prize} $GBT!") + .WithContent($"<@!{target.DiscordId}> - **{ctx.GetDiscordMember().Username}** successfully hacked **{target.Name}** and took {prize} $GBT!") let getArsenalEmbed (player : PlayerData) = DiscordFollowupMessageBuilder() From 3014df6b5668238d980526f6a4d32d311b4d6bf6 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 3 Jun 2022 23:06:44 +0700 Subject: [PATCH 20/25] put it at the end --- Bot/Embeds.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Embeds.fs b/Bot/Embeds.fs index 05a3931..d37fe70 100644 --- a/Bot/Embeds.fs +++ b/Bot/Embeds.fs @@ -141,7 +141,7 @@ let responseCreatedShield (shield : ShieldItem) = let eventSuccessfulHack (ctx : IDiscordContext) target prize = DiscordMessageBuilder() .WithAllowedMention(UserMention(target.DiscordId)) - .WithContent($"<@!{target.DiscordId}> - **{ctx.GetDiscordMember().Username}** successfully hacked **{target.Name}** and took {prize} $GBT!") + .WithContent($"**{ctx.GetDiscordMember().Username}** successfully hacked **{target.Name}** and took {prize} $GBT! - <@!{target.DiscordId}>") let getArsenalEmbed (player : PlayerData) = DiscordFollowupMessageBuilder() From a3ee9bbc1a5588c5f073b6d0eeafe06882c45078 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 4 Jun 2022 12:31:46 +0700 Subject: [PATCH 21/25] Change mentions in other parts and GBT copy --- Bot/Games/HackerBattle.fs | 8 ++++---- Bot/InviteTracker.fs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Bot/Games/HackerBattle.fs b/Bot/Games/HackerBattle.fs index c693712..0b3ccfe 100644 --- a/Bot/Games/HackerBattle.fs +++ b/Bot/Games/HackerBattle.fs @@ -66,7 +66,7 @@ let checkPlayerHasShieldSlotsAvailable player = let checkTargetHasFunds target player = match target.Bank <= 0 with - | true -> Error $"Looks like the poor bastard has no $GBT... pick a different victim." + | true -> Error $"Looks like the poor bastard has no 💰$GBT... pick a different victim." | false -> Ok player let strengthBonus attacker defender = @@ -129,13 +129,13 @@ let successfulHack (ctx : IDiscordContext) attacker defender (hack : HackItem) = let failedHack (ctx : IDiscordContext) attacker defender (hack : HackItem) = async { let lostAmount = if hack.Power < int attacker.Bank then hack.Power else int attacker.Bank - let msg = $"Hack failed! {defender.Name} was able to mount a successful defense! You lost {lostAmount} $GBT!" + let msg = $"Hack failed! {defender.Name} was able to mount a successful defense! You lost {lostAmount} 💰$GBT!" do! sendFollowUpMessage ctx msg do! updateCombatants false attacker defender hack (-lostAmount * 1) let builder = DiscordMessageBuilder() - builder.WithContent($"Hacking attempt failed! <@{defender.DiscordId}> defended hack from {ctx.GetDiscordMember().Username} and took {lostAmount} $GBT from them! ") |> ignore + builder.WithContent($"Hacking attempt failed! **{defender.Name}** defended hack from **{ctx.GetDiscordMember().Username}** and took {lostAmount} 💰$GBT from them! <@!{defender.DiscordId}>") |> ignore let channel = (ctx.GetGuild().GetChannel(GuildEnvironment.channelEventsHackerBattle)) do! channel.SendMessageAsync(builder) |> Async.AwaitTask @@ -223,7 +223,7 @@ let handleDefense (ctx : IDiscordContext) = } do! DbService.addPlayerEvent p.DiscordId defense |> Async.Ignore let builder = DiscordMessageBuilder() - builder.WithContent($"{ctx.GetDiscordMember().Username} has protected their system!") |> ignore + builder.WithContent($"**{ctx.GetDiscordMember().Username}** has protected their system!") |> ignore let channel = ctx.GetGuild().GetChannel(GuildEnvironment.channelEventsHackerBattle) do! channel.SendMessageAsync(builder) |> Async.AwaitTask diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index a1887bb..9a85a64 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -246,7 +246,7 @@ let getInvitedUsersForId (user : DiscordUser) (ctx : IDiscordContext) = let mutable count = 0 for user in users do count <- count + 1 - sb.AppendLine($"{count}.) <@{user}>") |> ignore + sb.AppendLine($"{count}.) <@!{user}>") |> ignore let msg = let str = if users.Length > 0 then @@ -300,7 +300,7 @@ let acceptInvite (guild : DiscordGuild) discordId memberName = do! match GuildEnvironment.botClientRecruit with | Some recruitBot -> async { let builder = DiscordMessageBuilder() - builder.WithContent($"{memberName} was recruited and is now a Degen. <@{player.DiscordId}> just earned {InviteRewardAmount} 💰$GBT for their efforts!") |> ignore + builder.WithContent($"{memberName} was recruited and is now a Degen. **{player.Name}** just earned `{InviteRewardAmount} 💰$GBT` for their efforts! - <@!{player.DiscordId}>") |> ignore let channel = guild.GetChannel(GuildEnvironment.channelEventsHackerBattle) do! recruitBot.SendMessageAsync(channel, builder) |> Async.AwaitTask @@ -327,7 +327,7 @@ let sendInitialEmbed (ctx : IDiscordContext) = 2️⃣ Share your unique link with Degenz **__Bonus__** -💰 Earn an extra 100 $GBT for every invite! +💰 Earn an extra 100 💰$GBT for every invite! **Every invite increases your chances of winning* """ @@ -498,7 +498,7 @@ let submitAddress (address : string) (ctx : IDiscordContext) = Keep an eye on <#{GuildEnvironment.channelAnnouncements}> for updates.""" let builder = DiscordMessageBuilder() - builder.WithContent($"{ctx.GetDiscordMember().Username} submitted their wallet address in <#{GuildEnvironment.channelSubmitWallet}> and confirmed whitelist") |> ignore + builder.WithContent($"**{ctx.GetDiscordMember().Username}** submitted their wallet address in <#{GuildEnvironment.channelSubmitWallet}> and confirmed whitelist") |> ignore let channel = (ctx.GetGuild().GetChannel(GuildEnvironment.channelEventsHackerBattle)) do! channel.SendMessageAsync(builder) |> Async.AwaitTask From 21e23b9bdb3e8c33826670baf075ecc116247acf Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 5 Jun 2022 13:57:02 +0700 Subject: [PATCH 22/25] Filter out unlisted items from inventory --- Bot/DbService.fs | 19 +++++++++++++++++++ Bot/Games/Store.fs | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Bot/DbService.fs b/Bot/DbService.fs index 872edb7..9847458 100644 --- a/Bot/DbService.fs +++ b/Bot/DbService.fs @@ -120,6 +120,25 @@ let getStoreItems (storeId : string) = }) |> Async.AwaitTask +let getAllActiveStoreItems () = + connStr + |> Sql.connect + |> Sql.query """ + SELECT store_id,stock,available,limit_stock,i.id,name,description,icon_url,image_url,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 item i on store_item.item_id = i.id + WHERE store_item.unlisted = false + """ + |> Sql.executeAsync (fun reader -> { + StoreId = reader.string "store_id" + Stock = reader.int "stock" + LimitStock = reader.bool "limit_stock" + Available = reader.bool "available" + StoreItem.Item = readItem reader + }) + |> Async.AwaitTask + let getStoreItemBySymbol (itemSymbol : string) = connStr |> Sql.connect diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index 68e703a..b66e754 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -195,10 +195,11 @@ let getSellEmbed (items : Inventory) = .AsEphemeral(true) let showJpegsEmbed (ctx : IDiscordContext) = PlayerInteractions.executePlayerAction ctx (fun player -> async { + let! storeItems = DbService.getAllActiveStoreItems () let jpegs = player.Inventory |> Inventory.getItemsByType ItemType.Jpeg - |> List.map (fun i -> { StoreId = "BACKALLEY" ; Item = i ; Stock = 1 ; LimitStock = false ; Available = true }) + |> List.choose (fun ii -> storeItems |> List.tryFind (fun si -> si.Item.Id = ii.Id)) match jpegs with | [] -> do! Messaging.sendFollowUpMessage ctx $"You currently do not own any jpegs or raffle tickets. Go to <#{GuildEnvironment.channelBackAlley}> to buy some" | jpegs -> From 3f5c9f96523696f4475abd8860ddbbcb5d3729e9 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sun, 5 Jun 2022 14:19:46 +0700 Subject: [PATCH 23/25] Show "Unlimited" --- Bot/Games/Store.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index b66e754..6cb7651 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -92,7 +92,7 @@ let getItemEmbeds owned (items : StoreItem list) = | Stackable max -> if owned then embed.AddField($"Owned", $"{count}", true) - else embed.AddField($"Max Allowed", $"{max}", true) + else embed.AddField($"Max Allowed", (if max > 1000 then "Unlimited" else string max), true) |> ignore // let totalOwned = getTotalOwnedOfItem item.Item (items |> List.map (fun i -> i.Item)) |> Option.defaultValue 1 // titleText <- $"{totalOwned}x " + titleText From ba56e53fb01be12861ff01a7f4b9c07663e9d9a8 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Tue, 7 Jun 2022 21:42:24 +0700 Subject: [PATCH 24/25] Async.Start store --- Bot/Games/Store.fs | 3 +++ Bot/Scripts/Whitelist.fsx | 1 + 2 files changed, 4 insertions(+) diff --git a/Bot/Games/Store.fs b/Bot/Games/Store.fs index 6cb7651..5a16fc6 100644 --- a/Bot/Games/Store.fs +++ b/Bot/Games/Store.fs @@ -357,6 +357,9 @@ let handleStoreEvents _ (event : ComponentInteractionCreateEventArgs) = builder.Content <- $"Incorrect Action identifier {id}" do! ctx.Respond(InteractionResponseType.ChannelMessageWithSource, builder) |> Async.AwaitTask } + |> Async.AwaitTask + |> Async.Start + Task.CompletedTask let sendBackalleyEmbed (ctx : IDiscordContext) = async { diff --git a/Bot/Scripts/Whitelist.fsx b/Bot/Scripts/Whitelist.fsx index fb947cb..0014d55 100644 --- a/Bot/Scripts/Whitelist.fsx +++ b/Bot/Scripts/Whitelist.fsx @@ -3,6 +3,7 @@ open Npgsql.FSharp open DSharpPlus open DSharpPlus.Entities +open Solnet.Programs open dotenv.net let prodEnv = DotEnv.Read(DotEnvOptions(envFilePaths = [ "./.prod.env" ])) From cc915ac7a6f0773838d4a689b3af46dade4dd6d9 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Tue, 7 Jun 2022 21:54:35 +0700 Subject: [PATCH 25/25] Typo --- Bot/InviteTracker.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bot/InviteTracker.fs b/Bot/InviteTracker.fs index 9a85a64..14034ba 100644 --- a/Bot/InviteTracker.fs +++ b/Bot/InviteTracker.fs @@ -357,7 +357,7 @@ let showWalletStatus (ctx : IDiscordContext) = | Some address -> do! Messaging.sendFollowUpMessage ctx $""" 🚀 __Mint Date:__ Mid June ✅ __Status:__ We have successfully received your wallet address: {address}""" - | None -> do! Messaging.sendFollowUpMessage ctx "You have no submitted your wallet yet. Type `/submit`, paste your **Solana Wallet Address**, then press enter" + | None -> do! Messaging.sendFollowUpMessage ctx "You haven't submitted a wallet yet. Type `/submit`, paste your **Solana Wallet Address**, then press enter" with ex -> printfn $"{ex.Message}" do! Messaging.sendFollowUpMessage ctx "Something went wrong retrieving your wallet address"