From 181dba0f96d8792e3565286b3983830674624cc5 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Tue, 24 Apr 2018 14:13:58 +0200 Subject: fixed sound playback moved post_processing to base constructor --- DiscoBot/Audio/Soundeffects.cs | 10 +++++++--- DiscoBot/Audio/Voice.cs | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'DiscoBot/Audio') diff --git a/DiscoBot/Audio/Soundeffects.cs b/DiscoBot/Audio/Soundeffects.cs index 555a79c..485be28 100644 --- a/DiscoBot/Audio/Soundeffects.cs +++ b/DiscoBot/Audio/Soundeffects.cs @@ -13,7 +13,8 @@ Monterkill, Finish, Wrong, - Magic + Magic, + Stupid } public static class SoundEffects @@ -40,9 +41,11 @@ case Sound.Nooo: url = "https://www.myinstants.com/media/sounds/nooo.swf.mp3"; break; + case Sound.Stupid: + url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3"; + vol = 10; + break; case Sound.Wrong: - // url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3"; - // vol = 10; url = "https://www.myinstants.com/media/sounds/wrong-answer-sound-effect.mp3"; vol = 50; break; @@ -52,6 +55,7 @@ { // await Dsa.Service.SendAudioAsync(url, vol); await Voice.SendAsync(url, vol); + return; } throw new Exception("Ton Existiert nicht"); diff --git a/DiscoBot/Audio/Voice.cs b/DiscoBot/Audio/Voice.cs index d1f7915..7a7da5c 100644 --- a/DiscoBot/Audio/Voice.cs +++ b/DiscoBot/Audio/Voice.cs @@ -12,6 +12,7 @@ using Discord; using Discord.Audio; using Discord.Commands; + using Discord.WebSocket; public class Voice : ModuleBase { @@ -61,6 +62,11 @@ [Command("leave", RunMode = RunMode.Async)] public async Task LeaveChannelAsync(IVoiceChannel channel = null) { + if (!((SocketGuildUser)this.Context.User).Roles.ToList().Exists(v => v.Name.Equals("Meister"))) + { + await this.ReplyAsync("```xl\n Keine ausreichenden Berechtigunen\n```"); + return; + } if (Client != null) { var wait = SoundEffects.Play(Sound.Nooo); -- cgit v1.2.3-70-g09d2