pushed this, but it doesn't do anything, just to prevent errors in forks

This commit is contained in:
Master Kwoth 2016-02-11 13:36:17 +01:00
parent 8d4d7252ec
commit 2bb4f93e10

View File

@ -0,0 +1,44 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Discord.Commands;
using System.Collections.Concurrent;
using Discord;
namespace NadekoBot.Commands {
class VoiceNotificationCommand : DiscordCommand {
public VoiceNotificationCommand() : base() {
//NadekoBot.client.
}
//voicechannel/text channel
ConcurrentDictionary<Channel, Channel> subscribers = new ConcurrentDictionary<Channel, Channel>();
public override Func<CommandEventArgs, Task> DoFunc() => async e => {
var arg = e.GetArg("voice_name");
if (string.IsNullOrWhiteSpace("voice_name"))
return;
var voiceChannel = e.Server.FindChannels(arg, ChannelType.Voice).FirstOrDefault();
if (voiceChannel == null)
return;
if (subscribers.ContainsKey(voiceChannel)) {
await e.Channel.SendMessage("`Voice channel notifications disabled.`");
return;
}
if (subscribers.TryAdd(voiceChannel, e.Channel)) {
await e.Channel.SendMessage("`Voice channel notifications enabled.`");
}
};
public override void Init(CommandGroupBuilder cgb) {
/*
cgb.CreateCommand(".voicenotif")
.Description("Enables notifications on who joined/left the voice channel.\n**Usage**:.voicenotif Karaoke club")
.Parameter("voice_name", ParameterType.Unparsed)
.Do(DoFunc());
*/
}
}
}