From d518a53b15b10a8b3a2d0335ea2d3a48aa610b5f Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Tue, 25 Sep 2018 22:58:12 +0200 Subject: Updated to Discord.Net-2.00-beta --- DiscoBot/App.config | 4 +-- DiscoBot/Auxiliary/CommandExtension.cs | 11 +++++-- DiscoBot/Commands/MiscCommands.cs | 9 +++++- DiscoBot/DiscoBot.csproj | 48 +++++++++++++++--------------- DiscoBot/packages.config | 28 +++++++++--------- DiscoBot/session.json | 54 ---------------------------------- 6 files changed, 56 insertions(+), 98 deletions(-) diff --git a/DiscoBot/App.config b/DiscoBot/App.config index 2a3afc9..e99cd82 100644 --- a/DiscoBot/App.config +++ b/DiscoBot/App.config @@ -12,7 +12,7 @@ - + @@ -20,7 +20,7 @@ - + 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(); + foreach (var message in test) + { + waiters.Add((message as IUserMessage).DeleteAsync()); + } + Task.WaitAll(waiters.ToArray()); } public static async Task ReplyAsync(this ModuleBase m, IEnumerable message, bool directMessage = false) diff --git a/DiscoBot/Commands/MiscCommands.cs b/DiscoBot/Commands/MiscCommands.cs index bef39c6..53bc42c 100644 --- a/DiscoBot/Commands/MiscCommands.cs +++ b/DiscoBot/Commands/MiscCommands.cs @@ -180,7 +180,14 @@ namespace DiscoBot.Commands if (Permissions.Check(Context, new[] { "Admin", "Mod", "Meister" })) { - await Context.Channel.DeleteMessagesAsync(messages); + + var waiters = new List(); + foreach (var message in messages) + { + waiters.Add((message as IUserMessage).DeleteAsync()); + } + + Task.WaitAll(waiters.ToArray()); } } diff --git a/DiscoBot/DiscoBot.csproj b/DiscoBot/DiscoBot.csproj index 7049b03..1f3a799 100644 --- a/DiscoBot/DiscoBot.csproj +++ b/DiscoBot/DiscoBot.csproj @@ -35,46 +35,46 @@ 4 - - ..\packages\Discord.Net.Commands.1.0.2\lib\netstandard1.1\Discord.Net.Commands.dll + + ..\packages\Discord.Net.Commands.2.0.0-beta\lib\netstandard1.1\Discord.Net.Commands.dll - - ..\packages\Discord.Net.Core.1.0.2\lib\net45\Discord.Net.Core.dll + + ..\packages\Discord.Net.Core.2.0.0-beta\lib\net45\Discord.Net.Core.dll - - ..\packages\Discord.Net.Rest.1.0.2\lib\net45\Discord.Net.Rest.dll + + ..\packages\Discord.Net.Rest.2.0.0-beta\lib\net45\Discord.Net.Rest.dll ..\packages\Discord.Net.Rpc.1.0.2\lib\net45\Discord.Net.Rpc.dll - - ..\packages\Discord.Net.Webhook.1.0.2\lib\netstandard1.1\Discord.Net.Webhook.dll + + ..\packages\Discord.Net.Webhook.2.0.0-beta\lib\netstandard1.1\Discord.Net.Webhook.dll - - ..\packages\Discord.Net.WebSocket.1.0.2\lib\net45\Discord.Net.WebSocket.dll + + ..\packages\Discord.Net.WebSocket.2.0.0-beta\lib\net45\Discord.Net.WebSocket.dll - - ..\packages\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll + + ..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll - - ..\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll + + ..\packages\Microsoft.Extensions.DependencyInjection.2.2.0-preview2-35157\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0-preview2-35157\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll - - ..\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll + + ..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll - - ..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net46\System.Diagnostics.DiagnosticSource.dll - - ..\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll + + ..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll @@ -153,11 +153,11 @@ + Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}". - + - \ No newline at end of file diff --git a/DiscoBot/packages.config b/DiscoBot/packages.config index ae800df..4aa29aa 100644 --- a/DiscoBot/packages.config +++ b/DiscoBot/packages.config @@ -1,32 +1,32 @@  - - - - + + + + - - - - - - + + + + + + - + - + - + - + diff --git a/DiscoBot/session.json b/DiscoBot/session.json index 03c46f3..d0c651d 100644 --- a/DiscoBot/session.json +++ b/DiscoBot/session.json @@ -6,68 +6,14 @@ "Name": "Felis Exodus Schattenwald", "Lebenspunkte_Aktuell": 30, "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 20 - }, - { - "Name": "Gardist", - "Lebenspunkte_Aktuell": 29, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 0 - }, - { - "Name": "Hartmut Reiher", - "Lebenspunkte_Aktuell": 31, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 0 - }, - { - "Name": "Helga vom Drachenei, Tausendsasserin", - "Lebenspunkte_Aktuell": 21, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 35 - }, - { - "Name": "Krenko", - "Lebenspunkte_Aktuell": 25, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 0 - }, - { - "Name": "Ledur Torfinson", - "Lebenspunkte_Aktuell": 39, - "Ausdauer_Aktuell": 0, "Astralpunkte_Aktuell": 0 }, - { - "Name": "Morla", - "Lebenspunkte_Aktuell": 26, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 13 - }, { "Name": "Numeri Illuminus", "Lebenspunkte_Aktuell": 28, "Ausdauer_Aktuell": 0, "Astralpunkte_Aktuell": 40 }, - { - "Name": "Potus", - "Lebenspunkte_Aktuell": 39, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 16 - }, - { - "Name": "Pump aus der Gosse", - "Lebenspunkte_Aktuell": 18, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 13 - }, - { - "Name": "Rhoktar4", - "Lebenspunkte_Aktuell": 34, - "Ausdauer_Aktuell": 0, - "Astralpunkte_Aktuell": 17 - }, { "Name": "Volant", "Lebenspunkte_Aktuell": 28, -- cgit v1.2.3-54-g00ecf