From 06a156d73f75949c8547e04ecb9ea404c1fe0a05 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 14 Jul 2016 05:45:45 +0200 Subject: [PATCH] removed @bot slm, #395 --- .../Modules/Conversations/Conversations.cs | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/NadekoBot/Modules/Conversations/Conversations.cs b/NadekoBot/Modules/Conversations/Conversations.cs index 215bfb90..cdc6eb26 100644 --- a/NadekoBot/Modules/Conversations/Conversations.cs +++ b/NadekoBot/Modules/Conversations/Conversations.cs @@ -171,38 +171,6 @@ namespace NadekoBot.Modules.Conversations await e.Channel.SendMessage(str).ConfigureAwait(false); }); - cgb.CreateCommand("slm") - .Description("Shows the message where you were last mentioned in this channel (checks last 10k messages)") - .Do(async e => - { - - Message msg = null; - var msgs = (await e.Channel.DownloadMessages(100).ConfigureAwait(false)) - .Where(m => m.MentionedUsers.Contains(e.User)) - .OrderByDescending(m => m.Timestamp); - if (msgs.Any()) - msg = msgs.First(); - else - { - var attempt = 0; - Message lastMessage = null; - while (msg == null && attempt++ < 5) - { - var msgsarr = await e.Channel.DownloadMessages(100, lastMessage?.Id).ConfigureAwait(false); - msg = msgsarr - .Where(m => m.MentionedUsers.Contains(e.User)) - .OrderByDescending(m => m.Timestamp) - .FirstOrDefault(); - lastMessage = msgsarr.OrderBy(m => m.Timestamp).First(); - } - } - if (msg != null) - await e.Channel.SendMessage($"Last message mentioning you was at {msg.Timestamp}\n**Message from {msg.User.Name}:** {msg.RawText}") - .ConfigureAwait(false); - else - await e.Channel.SendMessage("I can't find a message mentioning you.").ConfigureAwait(false); - }); - cgb.CreateCommand("dump") .Description("Dumps all of the invites it can to dump.txt.** Owner Only.**") .Do(async e =>