summaryrefslogtreecommitdiff
path: root/DiscoBot/Audio
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-04-24 14:13:58 +0200
committerTrueDoctor <d-kobert@web.de>2018-04-24 14:13:58 +0200
commit181dba0f96d8792e3565286b3983830674624cc5 (patch)
tree9c6a5fc00bf69aad09d5a335c59a11854ae49002 /DiscoBot/Audio
parente5e0c1c5c9fb6afd68ebe9dc075af23f46f11e25 (diff)
fixed sound playback
moved post_processing to base constructor
Diffstat (limited to 'DiscoBot/Audio')
-rw-r--r--DiscoBot/Audio/Soundeffects.cs10
-rw-r--r--DiscoBot/Audio/Voice.cs6
2 files changed, 13 insertions, 3 deletions
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);