diff --git a/DegenzGame.sln b/DegenzGame.sln index 0fd26a1..706df5e 100644 --- a/DegenzGame.sln +++ b/DegenzGame.sln @@ -13,6 +13,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PlayerInteractions", "Playe 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 Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -42,5 +44,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 EndGlobalSection EndGlobal diff --git a/SlotMachine/.dockerignore b/SlotMachine/.dockerignore new file mode 100644 index 0000000..38bece4 --- /dev/null +++ b/SlotMachine/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/SlotMachine/Dockerfile b/SlotMachine/Dockerfile new file mode 100644 index 0000000..083067f --- /dev/null +++ b/SlotMachine/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["Roulette/Roulette.fsproj", "Roulette/"] +RUN dotnet restore "Roulette/Roulette.fsproj" +COPY . . +WORKDIR "/src/Roulette" +RUN dotnet build "Roulette.fsproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "Roulette.fsproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "Roulette.dll"] diff --git a/SlotMachine/SlotMachine.fs b/SlotMachine/SlotMachine.fs new file mode 100644 index 0000000..9f4fca4 --- /dev/null +++ b/SlotMachine/SlotMachine.fs @@ -0,0 +1,43 @@ +open System.Threading.Tasks +open DSharpPlus +open DSharpPlus.Entities +open DSharpPlus.SlashCommands +open Emzi0767.Utilities +open DegenzGame.Shared + +type EmptyGlobalCommandToAvoidFamousDuplicateSlashCommandsBug() = inherit ApplicationCommandModule () + +type SlotMachine() = + inherit ApplicationCommandModule () + + [] + member this.AttackCommand (ctx : InteractionContext) = + () + +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/SlotMachine/SlotMachine.fsproj b/SlotMachine/SlotMachine.fsproj new file mode 100644 index 0000000..d8f9454 --- /dev/null +++ b/SlotMachine/SlotMachine.fsproj @@ -0,0 +1,21 @@ + + + + Exe + net6.0 + Linux + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SlotMachine/paket.references b/SlotMachine/paket.references new file mode 100644 index 0000000..a5fcca2 --- /dev/null +++ b/SlotMachine/paket.references @@ -0,0 +1,7 @@ +FSharp.Core +DSharpPlus +// DSharpPlus.CommandsNext +// DSharpPlus.Interactivity +DSharpPlus.SlashCommands + +// MongoDB.Driver