summaryrefslogtreecommitdiff
path: root/DiscoBot/Commands/Voice.cs
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-04-09 13:13:54 +0200
committerTrueDoctor <d-kobert@web.de>2018-04-09 13:13:54 +0200
commit4ca7291ebee440d9f3ef2a1643d8d01b29006459 (patch)
tree1603fdf24f1ead61cf7dd23c09a9784cfb1c780e /DiscoBot/Commands/Voice.cs
parent82f07c959dc7a87251b4617e462003471e3cc071 (diff)
Added FileHandler to enable sending heros via Discord
Diffstat (limited to 'DiscoBot/Commands/Voice.cs')
-rw-r--r--DiscoBot/Commands/Voice.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/DiscoBot/Commands/Voice.cs b/DiscoBot/Commands/Voice.cs
index 72988d4..02210e8 100644
--- a/DiscoBot/Commands/Voice.cs
+++ b/DiscoBot/Commands/Voice.cs
@@ -39,10 +39,10 @@
[Command("play")]
public Task PlayAudioAsync(string path)
{
- return this.SendAsync(Client, path);
+ return SendAsync(path);
}
- private Process CreateStream(string path)
+ private static Process CreateStream(string path)
{
var ffmpeg = new ProcessStartInfo
{
@@ -54,12 +54,12 @@
return Process.Start(ffmpeg);
}
- private async Task SendAsync(IAudioClient client, string path)
+ private static async Task SendAsync(string path)
{
// Create FFmpeg using the previous example
- var ffmpeg = this.CreateStream(path);
+ var ffmpeg = CreateStream(path);
var output = ffmpeg.StandardOutput.BaseStream;
- var discord = client.CreatePCMStream(AudioApplication.Music);
+ var discord = Client.CreatePCMStream(AudioApplication.Music);
await output.CopyToAsync(discord);
await discord.FlushAsync();
}