summaryrefslogtreecommitdiff
path: root/DiscoBot/Audio
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-06-01 11:25:03 +0100
committerTrueDoctor <d-kobert@web.de>2018-06-01 11:25:03 +0100
commitf6edadbfcadbc9e38e22500a496a74dd49d96d8a (patch)
tree36749e99ee87b9f481254a890acfb7149e6b3fb8 /DiscoBot/Audio
parent181dba0f96d8792e3565286b3983830674624cc5 (diff)
added Permissions Class for easy Permission required commands
Diffstat (limited to 'DiscoBot/Audio')
-rw-r--r--DiscoBot/Audio/Soundeffects.cs29
-rw-r--r--DiscoBot/Audio/Voice.cs16
2 files changed, 32 insertions, 13 deletions
diff --git a/DiscoBot/Audio/Soundeffects.cs b/DiscoBot/Audio/Soundeffects.cs
index 485be28..9982947 100644
--- a/DiscoBot/Audio/Soundeffects.cs
+++ b/DiscoBot/Audio/Soundeffects.cs
@@ -10,19 +10,23 @@
Bell,
Ding,
Nooo,
- Monterkill,
+ Monsterkill,
Finish,
Wrong,
Magic,
- Stupid
+ Stupid,
+ Police,
+ Roblox
}
public static class SoundEffects
{
+ public static int Volume { get; set; } = 50;
+
public static async Task Play(Sound s)
{
string url = string.Empty;
- int vol = 256;
+ int volume = 256;
switch (s)
{
case Sound.Bell:
@@ -35,26 +39,35 @@
case Sound.Magic:
url = "https://www.myinstants.com/media/sounds/dream-harp-sound-effect.mp3";
break;
- case Sound.Monterkill:
+ case Sound.Monsterkill:
url = "https://www.myinstants.com/media/sounds/announcer_kill_monster_01.mp3";
break;
case Sound.Nooo:
url = "https://www.myinstants.com/media/sounds/nooo.swf.mp3";
break;
+ case Sound.Roblox:
+ url = "https://www.myinstants.com/media/sounds/roblox-death-sound_ytkBL7X.mp3";
+ break;
case Sound.Stupid:
url = "https://www.myinstants.com/media/sounds/stupid_dum_03.mp3";
- vol = 10;
+ volume = 10;
+ break;
+ case Sound.Police:
+ url = "https://www.myinstants.com/media/sounds/sound-of-the-police.mp3";
break;
case Sound.Wrong:
url = "https://www.myinstants.com/media/sounds/wrong-answer-sound-effect.mp3";
- vol = 50;
- break;
+ volume = 50;
+ break;
}
+ volume = (int)(volume * (Volume / 100.0));
+
+
if (url != string.Empty)
{
// await Dsa.Service.SendAudioAsync(url, vol);
- await Voice.SendAsync(url, vol);
+ await Voice.SendAsync(url, volume);
return;
}
diff --git a/DiscoBot/Audio/Voice.cs b/DiscoBot/Audio/Voice.cs
index 7a7da5c..f9fc7a3 100644
--- a/DiscoBot/Audio/Voice.cs
+++ b/DiscoBot/Audio/Voice.cs
@@ -62,11 +62,8 @@
[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;
- }
+// Permissions.Test(this.Context, "Meister");
+
if (Client != null)
{
var wait = SoundEffects.Play(Sound.Nooo);
@@ -76,6 +73,15 @@
}
}
+ [Command("volume")]
+ public async Task SetVolume(int volume)
+ {
+ if (volume <= 100 && volume >= 0)
+ {
+ SoundEffects.Volume = volume;
+ }
+ }
+
[Command("play", RunMode = RunMode.Async)]
public async Task PlayAudioAsync(string path)
{