From fd9a6a25f3543c7e0ce37d9a943ae1ce396104f5 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Wed, 19 Jan 2022 20:15:07 +0700 Subject: [PATCH] Move bots into single process --- DbService/DbService.fs | 4 +- DegenzGame.sln | 34 ++------- HackerBattle/HackerBattle.fs | 49 ------------ HackerBattle/HackerBattle.fsproj | 2 - PlayerInteractions/Bot.fs | 74 +++++++++++++++++++ .../HackerBattle.fs | 18 ++++- PlayerInteractions/Items.json | 62 ++++++++++++++++ PlayerInteractions/PlayerInteractions.fs | 38 ++-------- PlayerInteractions/PlayerInteractions.fsproj | 15 ++-- .../SlotMachine.fs | 35 +-------- {Store => PlayerInteractions}/Store.fs | 38 +--------- {Trainer => PlayerInteractions}/Trainer.fs | 27 +++---- Shared/Shared.fs | 2 +- Shared/Shared.fsproj | 2 +- SlotMachine/SlotMachine.fsproj | 3 - Store/Store.fsproj | 7 -- Trainer/Trainer.fsproj | 4 - 17 files changed, 196 insertions(+), 218 deletions(-) delete mode 100644 HackerBattle/HackerBattle.fs create mode 100644 PlayerInteractions/Bot.fs rename HackerBattle/Commands.fs => PlayerInteractions/HackerBattle.fs (95%) create mode 100644 PlayerInteractions/Items.json rename {SlotMachine => PlayerInteractions}/SlotMachine.fs (80%) rename {Store => PlayerInteractions}/Store.fs (91%) rename {Trainer => PlayerInteractions}/Trainer.fs (98%) diff --git a/DbService/DbService.fs b/DbService/DbService.fs index 4ce1b28..eccb511 100644 --- a/DbService/DbService.fs +++ b/DbService/DbService.fs @@ -1,7 +1,7 @@ -module DegenzGame.DbService +module Degenz.DbService open System -open DegenzGame.Shared +open Degenz.Shared open MongoDB.Bson open MongoDB.Driver diff --git a/DegenzGame.sln b/DegenzGame.sln index 69585bb..e865622 100644 --- a/DegenzGame.sln +++ b/DegenzGame.sln @@ -3,19 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30114.105 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HackerBattle", "HackerBattle\HackerBattle.fsproj", "{2A437756-3D5D-467D-9497-DF9789DB99CC}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Shared", "Shared\Shared.fsproj", "{5F34C24E-BA4E-4E57-9141-812775687360}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Store", "Store\Store.fsproj", "{CD88B0A6-DE42-4087-9B33-48FF84201633}" -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PlayerInteractions", "PlayerInteractions\PlayerInteractions.fsproj", "{FF9E58A6-1A1D-4DEC-B52D-265F215BF315}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "DbService", "DbService\DbService.fsproj", "{B1D3E1CC-451C-42D4-B054-D64E75E1A3B9}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "SlotMachine", "SlotMachine\SlotMachine.fsproj", "{3183BE8D-1CA6-4768-8606-BEF6F4EC8DE1}" -EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Trainer", "Trainer\Trainer.fsproj", "{2511151A-EC5A-4BF9-A3EA-EF996AC2A4F1}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Shared", "Shared\Shared.fsproj", "{BD80E85E-87C8-4F5F-941E-7DCAF9D69838}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -26,18 +18,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A437756-3D5D-467D-9497-DF9789DB99CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2A437756-3D5D-467D-9497-DF9789DB99CC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A437756-3D5D-467D-9497-DF9789DB99CC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2A437756-3D5D-467D-9497-DF9789DB99CC}.Release|Any CPU.Build.0 = Release|Any CPU - {5F34C24E-BA4E-4E57-9141-812775687360}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F34C24E-BA4E-4E57-9141-812775687360}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F34C24E-BA4E-4E57-9141-812775687360}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F34C24E-BA4E-4E57-9141-812775687360}.Release|Any CPU.Build.0 = Release|Any CPU - {CD88B0A6-DE42-4087-9B33-48FF84201633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD88B0A6-DE42-4087-9B33-48FF84201633}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD88B0A6-DE42-4087-9B33-48FF84201633}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD88B0A6-DE42-4087-9B33-48FF84201633}.Release|Any CPU.Build.0 = Release|Any CPU {FF9E58A6-1A1D-4DEC-B52D-265F215BF315}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FF9E58A6-1A1D-4DEC-B52D-265F215BF315}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF9E58A6-1A1D-4DEC-B52D-265F215BF315}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -46,13 +26,9 @@ Global {B1D3E1CC-451C-42D4-B054-D64E75E1A3B9}.Debug|Any CPU.Build.0 = Debug|Any CPU {B1D3E1CC-451C-42D4-B054-D64E75E1A3B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {B1D3E1CC-451C-42D4-B054-D64E75E1A3B9}.Release|Any CPU.Build.0 = Release|Any CPU - {3183BE8D-1CA6-4768-8606-BEF6F4EC8DE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3183BE8D-1CA6-4768-8606-BEF6F4EC8DE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3183BE8D-1CA6-4768-8606-BEF6F4EC8DE1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3183BE8D-1CA6-4768-8606-BEF6F4EC8DE1}.Release|Any CPU.Build.0 = Release|Any CPU - {2511151A-EC5A-4BF9-A3EA-EF996AC2A4F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2511151A-EC5A-4BF9-A3EA-EF996AC2A4F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2511151A-EC5A-4BF9-A3EA-EF996AC2A4F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2511151A-EC5A-4BF9-A3EA-EF996AC2A4F1}.Release|Any CPU.Build.0 = Release|Any CPU + {BD80E85E-87C8-4F5F-941E-7DCAF9D69838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD80E85E-87C8-4F5F-941E-7DCAF9D69838}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD80E85E-87C8-4F5F-941E-7DCAF9D69838}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD80E85E-87C8-4F5F-941E-7DCAF9D69838}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/HackerBattle/HackerBattle.fs b/HackerBattle/HackerBattle.fs deleted file mode 100644 index 3c5d2d0..0000000 --- a/HackerBattle/HackerBattle.fs +++ /dev/null @@ -1,49 +0,0 @@ -open System.Threading.Tasks -open DSharpPlus -open DSharpPlus.Entities -open DSharpPlus.SlashCommands -open Emzi0767.Utilities -open DegenzGame -open DegenzGame.Commands - -type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () - -type HackerGame() = - inherit ApplicationCommandModule () - - [] - member this.AttackCommand (ctx : InteractionContext, [] target : DiscordUser) = - Commands.attack ctx target - - [] - member this.DefendCommand (ctx : InteractionContext) = Commands.defend ctx - -let config = DiscordConfiguration() -config.Token <- "OTMyMzI5NDAzNjYzNDEzMjQ4.YeRZaw.ZyCo5L8HFsCvx8JuhdAwqrH3hZI" -config.TokenType <- TokenType.Bot -config.Intents <- DiscordIntents.All -//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace - -let client = new DiscordClient(config) - -client.add_ComponentInteractionCreated(AsyncEventHandler(handleButtonEvent)) - -let slash = client.UseSlashCommands() - -// My server -slash.RegisterCommands(922419263275425832uL); -// Degenz -//slash.RegisterCommands(922414052708327494uL); - -client.ConnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - -Task.Delay(-1) -|> Async.AwaitTask -|> Async.RunSynchronously - -client.DisconnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - diff --git a/HackerBattle/HackerBattle.fsproj b/HackerBattle/HackerBattle.fsproj index ef3cec8..260123c 100644 --- a/HackerBattle/HackerBattle.fsproj +++ b/HackerBattle/HackerBattle.fsproj @@ -14,8 +14,6 @@ - - diff --git a/PlayerInteractions/Bot.fs b/PlayerInteractions/Bot.fs new file mode 100644 index 0000000..5fc1c51 --- /dev/null +++ b/PlayerInteractions/Bot.fs @@ -0,0 +1,74 @@ +module Degenz.Bot + +open System.Threading.Tasks +open DSharpPlus +open DSharpPlus.SlashCommands +open Degenz.Shared +open Emzi0767.Utilities +open Degenz.PlayerInteractions +open Degenz.SlotMachine +open Degenz.Trainer +open Degenz.HackerBattle +open Degenz.Store + + +type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () + +let playerInteractionsConfig = DiscordConfiguration() +let trainerConfig = DiscordConfiguration() +let hackerBattleConfig = DiscordConfiguration() +let storeConfig = DiscordConfiguration() +let slotMachineConfig = DiscordConfiguration() + +let configs = [| playerInteractionsConfig ; trainerConfig ; hackerBattleConfig ; storeConfig ; slotMachineConfig ; |] + +for conf in configs do + conf.TokenType <- TokenType.Bot + conf.Intents <- DiscordIntents.All + +playerInteractionsConfig.Token <- "OTIyNDIyMDIyMTI1MDEwOTU1.YcBOcw.JxfW1CSIwEO7j6RbRFCnPZ-HoTk" +trainerConfig.Token <- "OTMzMDg4MTQyNDM5ODk5MTg4.YeccDQ.AbysjlHICgbNQVyduG6aGIHNpdE" +hackerBattleConfig.Token <- "OTMyMzI5NDAzNjYzNDEzMjQ4.YeRZaw.ZyCo5L8HFsCvx8JuhdAwqrH3hZI" +storeConfig.Token <- "OTMyMzA3NTE0ODc4NDg4NjY2.YeRFCA.3NXX4tLObXU3rVgPt8D1fE58FnY" +slotMachineConfig.Token <- "OTMyMzQ3NzQ1NDE3NzE1ODE0.YeRqgA.PHandjk0jQGIxlM8NlqKc7cJD3s" + +//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace + +let playerInteractionsBot = new DiscordClient(playerInteractionsConfig) +let trainerBot = new DiscordClient(trainerConfig) +let hackerBattleBot = new DiscordClient(hackerBattleConfig) +let storeBot = new DiscordClient(storeConfig) +let slotMachineBot = new DiscordClient(slotMachineConfig) + +let clients = [| playerInteractionsBot ; trainerBot ; hackerBattleBot ; storeBot ; slotMachineBot |] +let slashCommands = + clients + |> Array.map (fun c -> c.UseSlashCommands()) + +// My server +let joeServer = 922419263275425832uL +slashCommands.[0].RegisterCommands(joeServer); +slashCommands.[1].RegisterCommands(joeServer); +slashCommands.[2].RegisterCommands(joeServer); +slashCommands.[3].RegisterCommands(joeServer); +slashCommands.[4].RegisterCommands(joeServer); +// Degenz +//slash.RegisterCommands(922414052708327494uL); + +let run (client : DiscordClient) = + async { + do! client.ConnectAsync () |> Async.AwaitTask + } + +clients +|> Array.map run +|> Array.toSeq +|> Async.Parallel +|> Async.RunSynchronously +|> ignore + +Task.Delay(-1) +|> Async.AwaitTask +|> Async.RunSynchronously + + diff --git a/HackerBattle/Commands.fs b/PlayerInteractions/HackerBattle.fs similarity index 95% rename from HackerBattle/Commands.fs rename to PlayerInteractions/HackerBattle.fs index e63e0c0..12100fd 100644 --- a/HackerBattle/Commands.fs +++ b/PlayerInteractions/HackerBattle.fs @@ -1,4 +1,4 @@ -module DegenzGame.Commands +module Degenz.HackerBattle open System open System.Threading.Tasks @@ -6,7 +6,9 @@ open DSharpPlus open DSharpPlus.Entities open DSharpPlus.EventArgs open DSharpPlus.SlashCommands -open DegenzGame.Shared +open Degenz +open Emzi0767.Utilities +open Degenz.Shared [] // Degenz Server @@ -201,3 +203,15 @@ let handleButtonEvent (_ : DiscordClient) (event : ComponentInteractionCreateEve } } |> Async.StartAsTask :> Task + +type HackerGame() = + inherit ApplicationCommandModule () + + [] + member this.AttackCommand (ctx : InteractionContext, [] target : DiscordUser) = + attack ctx target + + [] + member this.DefendCommand (ctx : InteractionContext) = defend ctx + + diff --git a/PlayerInteractions/Items.json b/PlayerInteractions/Items.json new file mode 100644 index 0000000..17cb719 --- /dev/null +++ b/PlayerInteractions/Items.json @@ -0,0 +1,62 @@ +[ + { + "Name" : "Virus", + "ItemType" : { "Case" : "Weapon" }, + "Cost" : 5.0 + }, + { + "Name" : "Ransom", + "ItemType" : { "Case" : "Weapon" }, + "Cost" : 10.0 + }, + { + "Name" : "Worm", + "ItemType" : { "Case" : "Weapon" }, + "Cost" : 5.0 + }, + { + "Name" : "DDos", + "ItemType" : { "Case" : "Weapon" }, + "Cost" : 10.0 + }, + { + "Name" : "Crack", + "ItemType" : { "Case" : "Weapon" }, + "Cost" : 5.0 + }, + { + "Name" : "Injection", + "ItemType" : { "Case" : "Weapon" }, + "Cost" : 10.0 + }, + { + "Name" : "Firewall", + "ItemType" : { "Case" : "Shield" }, + "Cost" : 5.0 + }, + { + "Name" : "PortScan", + "ItemType" : { "Case" : "Shield" }, + "Cost" : 10.0 + }, + { + "Name" : "Encryption", + "ItemType" : { "Case" : "Shield" }, + "Cost" : 5.0 + }, + { + "Name" : "Hardening", + "ItemType" : { "Case" : "Shield" }, + "Cost" : 10.0 + }, + { + "Name" : "Cypher", + "ItemType" : { "Case" : "Shield" }, + "Cost" : 5.0 + }, + { + "Name" : "Sanitation", + "ItemType" : { "Case" : "Shield" }, + "Cost" : 10.0 + } +] diff --git a/PlayerInteractions/PlayerInteractions.fs b/PlayerInteractions/PlayerInteractions.fs index 38701e4..13fb2fa 100644 --- a/PlayerInteractions/PlayerInteractions.fs +++ b/PlayerInteractions/PlayerInteractions.fs @@ -1,10 +1,13 @@ +module Degenz.PlayerInteractions + open System open System.Threading.Tasks open DSharpPlus.Entities open DSharpPlus +open DSharpPlus.EventArgs open DSharpPlus.SlashCommands -open DegenzGame -open DegenzGame.Shared +open Degenz +open Degenz.Shared module Commands = let newPlayer nickname (membr : uint64) = @@ -109,9 +112,7 @@ module Commands = } |> Async.StartAsTask :> Task -type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () - -type PlayerRegistration() = +type PlayerInteractions() = inherit ApplicationCommandModule () [] @@ -127,30 +128,3 @@ type PlayerRegistration() = member this.Leaderboard (ctx : InteractionContext) = Commands.leaderboard ctx -let config = DiscordConfiguration() -config.Token <- "OTIyNDIyMDIyMTI1MDEwOTU1.YcBOcw.JxfW1CSIwEO7j6RbRFCnPZ-HoTk" -config.TokenType <- TokenType.Bot -config.Intents <- DiscordIntents.All -//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace - -let client = new DiscordClient(config) - -let slash = client.UseSlashCommands() - -// My server -slash.RegisterCommands(922419263275425832uL); -// Degenz -//slash.RegisterCommands(922414052708327494uL); - -client.ConnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - -Task.Delay(-1) -|> Async.AwaitTask -|> Async.RunSynchronously - -client.DisconnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - diff --git a/PlayerInteractions/PlayerInteractions.fsproj b/PlayerInteractions/PlayerInteractions.fsproj index 32cf28f..fcad2ff 100644 --- a/PlayerInteractions/PlayerInteractions.fsproj +++ b/PlayerInteractions/PlayerInteractions.fsproj @@ -6,17 +6,22 @@ Linux PlayerRegistration - - - - + + + + + + + + + PreserveNewest + - \ No newline at end of file diff --git a/SlotMachine/SlotMachine.fs b/PlayerInteractions/SlotMachine.fs similarity index 80% rename from SlotMachine/SlotMachine.fs rename to PlayerInteractions/SlotMachine.fs index 9a89f14..b992edf 100644 --- a/SlotMachine/SlotMachine.fs +++ b/PlayerInteractions/SlotMachine.fs @@ -1,15 +1,14 @@ +module Degenz.SlotMachine + open System open System.Threading.Tasks open DSharpPlus open DSharpPlus.Entities open DSharpPlus.SlashCommands -open DegenzGame -open DegenzGame.Shared +open Degenz.Shared let slots = [| "https://i.ibb.co/pKqZdr7/cherry.png" ; "https://i.ibb.co/JnghQsL/lemon.jpg" ; "https://i.ibb.co/1JTFPSs/seven.png" |] -type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () - type SlotMachine() = inherit ApplicationCommandModule () @@ -79,31 +78,3 @@ type SlotMachine() = } |> Async.StartAsTask :> Task - -let config = DiscordConfiguration() -config.Token <- "OTMyMzQ3NzQ1NDE3NzE1ODE0.YeRqgA.PHandjk0jQGIxlM8NlqKc7cJD3s" -config.TokenType <- TokenType.Bot -config.Intents <- DiscordIntents.All -//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace - -let client = new DiscordClient(config) - -let slash = client.UseSlashCommands() - -// My server -slash.RegisterCommands(922419263275425832uL); -// Degenz -//slash.RegisterCommands(922414052708327494uL); - -client.ConnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - -Task.Delay(-1) -|> Async.AwaitTask -|> Async.RunSynchronously - -client.DisconnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - diff --git a/Store/Store.fs b/PlayerInteractions/Store.fs similarity index 91% rename from Store/Store.fs rename to PlayerInteractions/Store.fs index e932a92..cbd33b2 100644 --- a/Store/Store.fs +++ b/PlayerInteractions/Store.fs @@ -1,11 +1,12 @@ -open System +module Degenz.Store + open System.Threading.Tasks open DSharpPlus.Entities open DSharpPlus open DSharpPlus.EventArgs open DSharpPlus.SlashCommands -open DegenzGame -open DegenzGame.Shared +open Degenz +open Degenz.Shared open Emzi0767.Utilities open Newtonsoft.Json @@ -175,8 +176,6 @@ module Commands = } |> Async.StartAsTask :> Task -type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () - type Store() = inherit ApplicationCommandModule () @@ -195,32 +194,3 @@ type Store() = member this.SellItem (ctx : InteractionContext) = Commands.sellItem ctx -let config = DiscordConfiguration() -config.Token <- "OTMyMzA3NTE0ODc4NDg4NjY2.YeRFCA.3NXX4tLObXU3rVgPt8D1fE58FnY" -config.TokenType <- TokenType.Bot -config.Intents <- DiscordIntents.All -//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace - -let client = new DiscordClient(config) - -client.add_ComponentInteractionCreated(AsyncEventHandler(Commands.handleSellButtonEvents)) - -let slash = client.UseSlashCommands() - -// My server -slash.RegisterCommands(922419263275425832uL); -// Degenz -//slash.RegisterCommands(922414052708327494uL); - -client.ConnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - -Task.Delay(-1) -|> Async.AwaitTask -|> Async.RunSynchronously - -client.DisconnectAsync () -|> Async.AwaitTask -|> Async.RunSynchronously - diff --git a/Trainer/Trainer.fs b/PlayerInteractions/Trainer.fs similarity index 98% rename from Trainer/Trainer.fs rename to PlayerInteractions/Trainer.fs index 39de2a6..c25280b 100644 --- a/Trainer/Trainer.fs +++ b/PlayerInteractions/Trainer.fs @@ -1,15 +1,13 @@ -open System +module Degenz.Trainer + open System.Threading.Tasks open DSharpPlus open DSharpPlus.Entities open DSharpPlus.EventArgs open DSharpPlus.SlashCommands -open DegenzGame -open DegenzGame.Shared +open Degenz.Shared open Emzi0767.Utilities -type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () - type Trainer() = inherit ApplicationCommandModule () @@ -71,16 +69,6 @@ type Trainer() = } |> Async.StartAsTask :> Task -let config = DiscordConfiguration() -config.Token <- "OTMzMDg4MTQyNDM5ODk5MTg4.YeccDQ.AbysjlHICgbNQVyduG6aGIHNpdE" -config.TokenType <- TokenType.Bot -config.Intents <- DiscordIntents.All -//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace - -let client = new DiscordClient(config) - -let slash = client.UseSlashCommands() - let sendMessage (event : ComponentInteractionCreateEventArgs) msg = async { let builder = DiscordFollowupMessageBuilder() @@ -158,6 +146,15 @@ let handleButtonEvent (_ : DiscordClient) (event : ComponentInteractionCreateEve |> Async.StartAsTask :> Task +let config = DiscordConfiguration() +config.Token <- "OTMzMDg4MTQyNDM5ODk5MTg4.YeccDQ.AbysjlHICgbNQVyduG6aGIHNpdE" +config.TokenType <- TokenType.Bot +config.Intents <- DiscordIntents.All +//config.MinimumLogLevel <- Microsoft.Extensions.Logging.LogLevel.Trace + +let client = new DiscordClient(config) + +let slash = client.UseSlashCommands() client.add_ComponentInteractionCreated(AsyncEventHandler(handleButtonEvent)) diff --git a/Shared/Shared.fs b/Shared/Shared.fs index 2dd7691..0e10305 100644 --- a/Shared/Shared.fs +++ b/Shared/Shared.fs @@ -1,4 +1,4 @@ -module DegenzGame.Shared +module Degenz.Shared open System open DSharpPlus diff --git a/Shared/Shared.fsproj b/Shared/Shared.fsproj index 303067d..e855264 100644 --- a/Shared/Shared.fsproj +++ b/Shared/Shared.fsproj @@ -5,8 +5,8 @@ true - + \ No newline at end of file diff --git a/SlotMachine/SlotMachine.fsproj b/SlotMachine/SlotMachine.fsproj index d8f9454..ba7033c 100644 --- a/SlotMachine/SlotMachine.fsproj +++ b/SlotMachine/SlotMachine.fsproj @@ -5,9 +5,6 @@ net6.0 Linux - - - diff --git a/Store/Store.fsproj b/Store/Store.fsproj index 16412e7..ba7033c 100644 --- a/Store/Store.fsproj +++ b/Store/Store.fsproj @@ -5,17 +5,10 @@ net6.0 Linux - - - - - Items.json - PreserveNewest - diff --git a/Trainer/Trainer.fsproj b/Trainer/Trainer.fsproj index 48ccd28..7c098b3 100644 --- a/Trainer/Trainer.fsproj +++ b/Trainer/Trainer.fsproj @@ -3,11 +3,7 @@ net6.0 Linux - Exe - - -