diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..041b681 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "paket": { + "version": "6.2.1", + "commands": [ + "paket" + ] + } + } +} \ No newline at end of file diff --git a/PlayerInteractions/.dockerignore b/.dockerignore similarity index 100% rename from PlayerInteractions/.dockerignore rename to .dockerignore diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1d0c7b2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +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 . . + +RUN dotnet tool restore + +RUN dotnet restore "PlayerInteractions/PlayerInteractions.fsproj" + +WORKDIR "/src/PlayerInteractions" + +RUN dotnet build "PlayerInteractions.fsproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "PlayerInteractions.fsproj" -c Release -o /app/publish + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT "./PlayerInteractions" diff --git a/PlayerInteractions/Bot.fs b/PlayerInteractions/Bot.fs index 5fc1c51..3e07b14 100644 --- a/PlayerInteractions/Bot.fs +++ b/PlayerInteractions/Bot.fs @@ -41,17 +41,20 @@ 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()) + +let sc1 = playerInteractionsBot.UseSlashCommands() +let sc2 = trainerBot.UseSlashCommands() +let sc3 = hackerBattleBot.UseSlashCommands() +let sc4 = storeBot.UseSlashCommands() +let sc5 = slotMachineBot.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); +sc1.RegisterCommands(joeServer); +sc2.RegisterCommands(joeServer); +sc3.RegisterCommands(joeServer); +sc4.RegisterCommands(joeServer); +sc5.RegisterCommands(joeServer); // Degenz //slash.RegisterCommands(922414052708327494uL); @@ -63,7 +66,7 @@ let run (client : DiscordClient) = clients |> Array.map run |> Array.toSeq -|> Async.Parallel +|> Async.Sequential |> Async.RunSynchronously |> ignore diff --git a/PlayerInteractions/Dockerfile b/PlayerInteractions/Dockerfile deleted file mode 100644 index 801fe2e..0000000 --- a/PlayerInteractions/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -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 ["PlayerRegistration/PlayerRegistration.fsproj", "PlayerRegistration/"] -RUN dotnet restore "PlayerRegistration/PlayerRegistration.fsproj" -COPY . . -WORKDIR "/src/PlayerRegistration" -RUN dotnet build "PlayerRegistration.fsproj" -c Release -o /app/build - -FROM build AS publish -RUN dotnet publish "PlayerRegistration.fsproj" -c Release -o /app/publish - -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "PlayerRegistration.dll"] diff --git a/paket.dependencies b/paket.dependencies index f9261fa..3c855a5 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -8,6 +8,6 @@ nuget FSharp.Core >= 6.0.0 source https://nuget.emzi0767.com/api/v3/index.json nuget DSharpPlus >= 4.2.0-nightly-01054 -nuget DSharpPlus.SlashCommands >= 4.2.0-nightly-01054 +nuget DSharpPlus.SlashCommands >= 4.2.0-nightly-01061 nuget MongoDB.Driver diff --git a/paket.lock b/paket.lock index ac4ebf6..564e343 100644 --- a/paket.lock +++ b/paket.lock @@ -468,7 +468,7 @@ NUGET System.Runtime (>= 4.3) System.ValueTuple (4.5) remote: https://nuget.emzi0767.com/api/v3/index.json - DSharpPlus (4.2.0-nightly-01059) + DSharpPlus (4.2.0-nightly-01061) Emzi0767.Common (>= 2.6.2) Microsoft.Extensions.Logging.Abstractions (>= 5.0) Newtonsoft.Json (>= 13.0.1) @@ -478,6 +478,6 @@ NUGET System.Net.WebSockets.Client (>= 4.3.2) System.Runtime.InteropServices.RuntimeInformation (>= 4.3) System.Threading.Channels (>= 5.0) - DSharpPlus.SlashCommands (4.2.0-nightly-01059) - DSharpPlus (>= 4.2.0-nightly-01059) + DSharpPlus.SlashCommands (4.2.0-nightly-01061) + DSharpPlus (>= 4.2.0-nightly-01061) Microsoft.Extensions.DependencyInjection (>= 5.0.1)