This commit is contained in:
2022-07-09 10:26:36 +03:00
parent 3839e4d838
commit 82a3744d48
4 changed files with 5 additions and 3 deletions

Binary file not shown.

View File

@@ -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;

View File

@@ -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)