diff --git a/Sharpy/Program.cs b/Sharpy/Program.cs index e31339d..cf916ea 100644 --- a/Sharpy/Program.cs +++ b/Sharpy/Program.cs @@ -4,6 +4,8 @@ using System.Threading.Tasks; using DSharpPlus; using DSharpPlus.CommandsNext; using DSharpPlus.Entities; +using DSharpPlus.Lavalink; +using DSharpPlus.Net; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -46,7 +48,6 @@ var services = new ServiceCollection() .BuildServiceProvider(); /* -var lavalink = discord.UseLavalink(); var interactivity = discord.UseInteractivity(); var voice = discord.UseVoiceNext(); */ @@ -67,6 +68,9 @@ var commands = discord.UseCommandsNext(new CommandsNextConfiguration commands.RegisterCommands(Assembly.GetExecutingAssembly()); +// Register Lavalink +var lavalink = discord.UseLavalink(); + /*// Register Slash Commands var slash = discord.UseSlashCommands(new SlashCommandsConfiguration { @@ -74,4 +78,24 @@ var slash = discord.UseSlashCommands(new SlashCommandsConfiguration });*/ await discord.ConnectAsync(new DiscordActivity("With DSharpPlus")); +await lavalink.ConnectAsync(new LavalinkConfiguration +{ + Password = config.GetSection("lavalink").GetValue("password"), + RestEndpoint = new ConnectionEndpoint + { + Hostname = config.GetSection("lavalink").GetValue("host"), + Port = config.GetSection("lavalink").GetValue("port"), + Secured = true + }, + ResumeTimeout = 30, + SocketAutoReconnect = true, + SocketEndpoint = new ConnectionEndpoint + { + Hostname = config.GetSection("lavalink").GetValue("host"), + Port = config.GetSection("lavalink").GetValue("port"), + Secured = true + }, + WebSocketCloseTimeout = 30 +}); + await Task.Delay(-1); diff --git a/Sharpy/Sharpy.csproj b/Sharpy/Sharpy.csproj index 7a0edf8..7a7be53 100644 --- a/Sharpy/Sharpy.csproj +++ b/Sharpy/Sharpy.csproj @@ -34,12 +34,12 @@ - - - - - - + + + + + + @@ -55,8 +55,7 @@ - - + diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile deleted file mode 100644 index d12f9b9..0000000 --- a/docker/alpine/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM alpine:3.13.6 - -WORKDIR /app - -RUN apk add libgcc libstdc++ - -COPY CSharpBot/bin/x64/Release/net6.0/publish/linux-x64/CSharpBot . - -ENTRYPOINT [ "./CSharpBot" ] diff --git a/docker/debian/Dockerfile b/docker/debian/Dockerfile deleted file mode 100644 index bef502d..0000000 --- a/docker/debian/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM debian:11.0 - -WORKDIR /app - -COPY CSharpBot/bin/x64/Release/net6.0/publish/linux-x64/CSharpBot . - -ENTRYPOINT [ "./CSharpBot" ]