summaryrefslogtreecommitdiff
path: root/DiscoBot/Auxiliary
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2018-09-25 22:58:12 +0200
committerDennis Kobert <d-kobert@web.de>2018-09-25 22:58:12 +0200
commitd518a53b15b10a8b3a2d0335ea2d3a48aa610b5f (patch)
treedbc93dafdc8217cb69d5b407a54cc429aaa7a63a /DiscoBot/Auxiliary
parent4b78a5d03e59a5d1456bc9ad24ee507e7c866432 (diff)
Updated to Discord.Net-2.00-beta
Diffstat (limited to 'DiscoBot/Auxiliary')
-rw-r--r--DiscoBot/Auxiliary/CommandExtension.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/DiscoBot/Auxiliary/CommandExtension.cs b/DiscoBot/Auxiliary/CommandExtension.cs
index e19149b..098e35f 100644
--- a/DiscoBot/Auxiliary/CommandExtension.cs
+++ b/DiscoBot/Auxiliary/CommandExtension.cs
@@ -43,9 +43,14 @@
{
messages.AddRange(task.ToList());
}
-
- m.Context.Channel.DeleteMessagesAsync(
- messages.Where(x => x.Content.StartsWith($"#{token}\n") && x.Author.IsBot));
+
+ var test = messages.Where(x => x.Content.StartsWith($"#{token}\n") && x.Author.IsBot).Select(c=>c );
+ var waiters = new List<Task>();
+ foreach (var message in test)
+ {
+ waiters.Add((message as IUserMessage).DeleteAsync());
+ }
+ Task.WaitAll(waiters.ToArray());
}
public static async Task ReplyAsync(this ModuleBase m, IEnumerable<string> message, bool directMessage = false)