-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
18 changed files
with
199 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ mono_crash.* | |
[Dd]ebugPublic/ | ||
[Rr]elease/ | ||
[Rr]eleases/ | ||
[Bb]uild/ | ||
x64/ | ||
x86/ | ||
[Ww][Ii][Nn]32/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
CloudTheWolf.DSharpPlus.Scaffolding.Worker/Actions/ClientErrors.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using DSharpPlus.EventArgs; | ||
using DSharpPlus; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace CloudTheWolf.DSharpPlus.Scaffolding.Worker.Actions | ||
{ | ||
internal class ClientErrors | ||
{ | ||
|
||
public static async Task Errored(DiscordClient sender, ClientErrorEventArgs e) | ||
{ | ||
try | ||
{ | ||
sender.ReconnectAsync(true); | ||
|
||
} | ||
catch (Exception ex) | ||
{ | ||
|
||
Environment.Exit(500); | ||
} | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
CloudTheWolf.DSharpPlus.Scaffolding.Worker/Actions/SocketErrors.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using DSharpPlus.EventArgs; | ||
using DSharpPlus; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace CloudTheWolf.DSharpPlus.Scaffolding.Worker.Actions | ||
{ | ||
using Microsoft.Extensions.Logging; | ||
using Serilog; | ||
|
||
internal class SocketErrors | ||
{ | ||
public static async Task Closed(DiscordClient sender, SocketCloseEventArgs e) | ||
{ | ||
try | ||
{ | ||
await sender.ReconnectAsync(true); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Log.Error(ex.Message); | ||
Environment.Exit(500); | ||
} | ||
|
||
} | ||
|
||
public static async Task Errored(DiscordClient sender, SocketErrorEventArgs e) | ||
{ | ||
try | ||
{ | ||
await sender.ReconnectAsync(true); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Log.Error(ex.Message); | ||
Environment.Exit(500); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
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 ["CloudTheWolf.DSharpPlus.Scaffolding.Worker/CloudTheWolf.DSharpPlus.Scaffolding.Worker.csproj", "CloudTheWolf.DSharpPlus.Scaffolding.Worker/"] | ||
RUN dotnet restore "CloudTheWolf.DSharpPlus.Scaffolding.Worker/CloudTheWolf.DSharpPlus.Scaffolding.Worker.csproj" | ||
COPY . . | ||
WORKDIR "/src/CloudTheWolf.DSharpPlus.Scaffolding.Worker" | ||
RUN dotnet build "CloudTheWolf.DSharpPlus.Scaffolding.Worker.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "CloudTheWolf.DSharpPlus.Scaffolding.Worker.csproj" -c Release -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "CloudTheWolf.DSharpPlus.Scaffolding.Worker.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk"> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectVersion>2.1</ProjectVersion> | ||
<DockerTargetOS>Linux</DockerTargetOS> | ||
<ProjectGuid>c326da53-b1d0-4751-9881-82b4140c6a0c</ProjectGuid> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="docker-compose.override.yml"> | ||
<DependentUpon>docker-compose.yml</DependentUpon> | ||
</None> | ||
<None Include="docker-compose.yml" /> | ||
<None Include=".dockerignore" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3.4' | ||
|
||
services: | ||
cloudthewolf.dsharpplus.scaffolding.worker: | ||
environment: | ||
- DOTNET_ENVIRONMENT=Development | ||
volumes: | ||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3.4' | ||
|
||
services: | ||
cloudthewolf.dsharpplus.scaffolding.worker: | ||
image: ${DOCKER_REGISTRY-}cloudthewolfdsharpplusscaffoldingworker | ||
build: | ||
context: . | ||
dockerfile: CloudTheWolf.DSharpPlus.Scaffolding.Worker/Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"profiles": { | ||
"Docker Compose": { | ||
"commandName": "DockerCompose", | ||
"commandVersion": "1.0", | ||
"serviceActions": { | ||
"cloudthewolf.dsharpplus.scaffolding.worker": "StartDebugging" | ||
} | ||
} | ||
} | ||
} |