From 82a3744d48e90a0650b2cac3d11eaa974adebb52 Mon Sep 17 00:00:00 2001 From: Wizzy69 Date: Sat, 9 Jul 2022 10:26:36 +0300 Subject: [PATCH] --- BUILDS/net6.0/MusicCommands.dll | Bin 17920 -> 17920 bytes .../net6.0/Plugins/Commands/MusicCommands.dll | Bin 17920 -> 17920 bytes DiscordBot/Program.cs | 3 ++- MusicCommands/Play.cs | 5 +++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BUILDS/net6.0/MusicCommands.dll b/BUILDS/net6.0/MusicCommands.dll index 729722c56b94d146dec23bf174d76efc07f0c9b6..23499242478e7c51d36af57950cc23b88106a227 100644 GIT binary patch delta 46 zcmZqZVQlDOoY27{lI*i_W6v8wM)A#+Lhfn;Ui~Sb+Nvd7mz1(hD?e|3b@K%a16}}~ CQxZY| delta 46 zcmV+}0MY+|i~)d*0g#9UOR+-bv5f2y0T#1)5=SNw`T`aZSn7gCrdYb#zTJO)v(Pv& E4Y{8avj6}9 diff --git a/BUILDS/net6.0/Plugins/Commands/MusicCommands.dll b/BUILDS/net6.0/Plugins/Commands/MusicCommands.dll index 729722c56b94d146dec23bf174d76efc07f0c9b6..23499242478e7c51d36af57950cc23b88106a227 100644 GIT binary patch delta 46 zcmZqZVQlDOoY27{lI*i_W6v8wM)A#+Lhfn;Ui~Sb+Nvd7mz1(hD?e|3b@K%a16}}~ CQxZY| delta 46 zcmV+}0MY+|i~)d*0g#9UOR+-bv5f2y0T#1)5=SNw`T`aZSn7gCrdYb#zTJO)v(Pv& E4Y{8avj6}9 diff --git a/DiscordBot/Program.cs b/DiscordBot/Program.cs index 0701871..4f5802a 100644 --- a/DiscordBot/Program.cs +++ b/DiscordBot/Program.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading.Tasks; +using Discord; +using Discord.Net.Queue; using DiscordBot.Discord.Core; using PluginManager; using PluginManager.Items; @@ -73,7 +75,6 @@ public class Program Config.SaveConfig(); - while (true) { Console.ForegroundColor = ConsoleColor.White; diff --git a/MusicCommands/Play.cs b/MusicCommands/Play.cs index eb6d73d..bf98e28 100644 --- a/MusicCommands/Play.cs +++ b/MusicCommands/Play.cs @@ -64,15 +64,16 @@ internal class Play : DBCommand } while (false); - Data.voiceChannel = (context.User as IGuildUser)?.VoiceChannel; + if (Data.voiceChannel == null) { await context.Channel.SendMessageAsync("User must be in a voice channel, or a voice channel must be passed as an argument."); return; } - Data.audioClient = await Data.voiceChannel.ConnectAsync(); + Data.audioClient = await Data.voiceChannel.ConnectAsync(true); + using (var ffmpeg = CreateStream(path)) using (var output = ffmpeg.StandardOutput.BaseStream)