diff --git a/NadekoBot/Modules/Conversations/Commands/CopyCommand.cs b/NadekoBot/Modules/Conversations/Commands/CopyCommand.cs deleted file mode 100644 index 48ef01f4..00000000 --- a/NadekoBot/Modules/Conversations/Commands/CopyCommand.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Discord.Commands; -using NadekoBot.Modules; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace NadekoBot.Classes.Conversations.Commands -{ - internal class CopyCommand : DiscordCommand - { - private readonly HashSet CopiedUsers = new HashSet(); - - public CopyCommand(DiscordModule module) : base(module) - { - NadekoBot.Client.MessageReceived += Client_MessageReceived; - } - - private async void Client_MessageReceived(object sender, Discord.MessageEventArgs e) - { - if (e.User.Id == NadekoBot.Client.CurrentUser.Id) return; - try - { - if (string.IsNullOrWhiteSpace(e.Message.Text)) - return; - if (CopiedUsers.Contains(e.User.Id)) - { - await e.Channel.SendMessage(e.Message.Text).ConfigureAwait(false); - } - } - catch { } - } - - public Func DoFunc() => async e => - { - if (CopiedUsers.Contains(e.User.Id)) return; - - CopiedUsers.Add(e.User.Id); - await e.Channel.SendMessage(" I'll start copying you now.").ConfigureAwait(false); - }; - - internal override void Init(CommandGroupBuilder cgb) - { - cgb.CreateCommand("copyme") - .Alias("cm") - .Description("Nadeko starts copying everything you say. Disable with cs") - .Do(DoFunc()); - - cgb.CreateCommand("cs") - .Alias("copystop") - .Description("Nadeko stops copying you") - .Do(StopCopy()); - } - - private Func StopCopy() => async e => - { - if (!CopiedUsers.Contains(e.User.Id)) return; - - CopiedUsers.Remove(e.User.Id); - await e.Channel.SendMessage(" I wont copy anymore.").ConfigureAwait(false); - }; - } -} diff --git a/NadekoBot/Modules/Conversations/Conversations.cs b/NadekoBot/Modules/Conversations/Conversations.cs index c15f29d9..606084b1 100644 --- a/NadekoBot/Modules/Conversations/Conversations.cs +++ b/NadekoBot/Modules/Conversations/Conversations.cs @@ -1,7 +1,6 @@ using Discord; using Discord.Commands; using Discord.Modules; -using NadekoBot.Classes.Conversations.Commands; using NadekoBot.DataModels; using NadekoBot.Extensions; using NadekoBot.Modules.Conversations.Commands; @@ -19,7 +18,6 @@ namespace NadekoBot.Modules.Conversations private const string firestr = "🔥 ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็ด้้้้้็็็็็้้้้้็็็็็้้้้้้้้็็็็็้้้้้็็็็็้้้้ 🔥"; public Conversations() { - commands.Add(new CopyCommand(this)); commands.Add(new RipCommand(this)); }