summaryrefslogtreecommitdiff
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
parent4b78a5d03e59a5d1456bc9ad24ee507e7c866432 (diff)
Updated to Discord.Net-2.00-beta
-rw-r--r--DiscoBot/App.config4
-rw-r--r--DiscoBot/Auxiliary/CommandExtension.cs11
-rw-r--r--DiscoBot/Commands/MiscCommands.cs9
-rw-r--r--DiscoBot/DiscoBot.csproj48
-rw-r--r--DiscoBot/packages.config28
-rw-r--r--DiscoBot/session.json54
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 @@
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Interactive.Async" publicKeyToken="94bc3704cddfc263" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
+ <bindingRedirect oldVersion="0.0.0.0-3.2.0.0" newVersion="3.2.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
@@ -20,7 +20,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.3.0" newVersion="1.2.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
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)
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<Task>();
+ 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 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Discord.Net.Commands, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\Discord.Net.Commands.1.0.2\lib\netstandard1.1\Discord.Net.Commands.dll</HintPath>
+ <Reference Include="Discord.Net.Commands, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Discord.Net.Commands.2.0.0-beta\lib\netstandard1.1\Discord.Net.Commands.dll</HintPath>
</Reference>
- <Reference Include="Discord.Net.Core, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\Discord.Net.Core.1.0.2\lib\net45\Discord.Net.Core.dll</HintPath>
+ <Reference Include="Discord.Net.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Discord.Net.Core.2.0.0-beta\lib\net45\Discord.Net.Core.dll</HintPath>
</Reference>
- <Reference Include="Discord.Net.Rest, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\Discord.Net.Rest.1.0.2\lib\net45\Discord.Net.Rest.dll</HintPath>
+ <Reference Include="Discord.Net.Rest, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Discord.Net.Rest.2.0.0-beta\lib\net45\Discord.Net.Rest.dll</HintPath>
</Reference>
<Reference Include="Discord.Net.Rpc, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Discord.Net.Rpc.1.0.2\lib\net45\Discord.Net.Rpc.dll</HintPath>
</Reference>
- <Reference Include="Discord.Net.Webhook, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\Discord.Net.Webhook.1.0.2\lib\netstandard1.1\Discord.Net.Webhook.dll</HintPath>
+ <Reference Include="Discord.Net.Webhook, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Discord.Net.Webhook.2.0.0-beta\lib\netstandard1.1\Discord.Net.Webhook.dll</HintPath>
</Reference>
- <Reference Include="Discord.Net.WebSocket, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
- <HintPath>..\packages\Discord.Net.WebSocket.1.0.2\lib\net45\Discord.Net.WebSocket.dll</HintPath>
+ <Reference Include="Discord.Net.WebSocket, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <HintPath>..\packages\Discord.Net.WebSocket.2.0.0-beta\lib\net45\Discord.Net.WebSocket.dll</HintPath>
</Reference>
- <Reference Include="FSharp.Core, Version=4.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>..\packages\FSharp.Core.4.3.4\lib\net45\FSharp.Core.dll</HintPath>
+ <Reference Include="FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\FSharp.Core.4.5.2\lib\net45\FSharp.Core.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.dll</HintPath>
+ <Reference Include="Microsoft.Extensions.DependencyInjection, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.2.2.0-preview2-35157\lib\net461\Microsoft.Extensions.DependencyInjection.dll</HintPath>
</Reference>
- <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
- <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.0.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
+ <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.2.0-preview2-35157\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
- <Reference Include="System.Collections.Immutable, Version=1.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
- <HintPath>..\packages\System.Collections.Immutable.1.4.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
+ <Reference Include="System.Collections.Immutable, Version=1.2.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Collections.Immutable.1.5.0\lib\netstandard2.0\System.Collections.Immutable.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
- <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.2.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
- <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.4.1\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
+ <Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
- <Reference Include="System.Interactive.Async, Version=3.0.3000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
- <HintPath>..\packages\System.Interactive.Async.3.1.1\lib\net46\System.Interactive.Async.dll</HintPath>
+ <Reference Include="System.Interactive.Async, Version=3.2.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
+ <HintPath>..\packages\System.Interactive.Async.3.2.0\lib\net46\System.Interactive.Async.dll</HintPath>
</Reference>
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
@@ -153,11 +153,11 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}".</ErrorText>
</PropertyGroup>
- <Error Condition="!Exists('..\packages\NETStandard.Library.2.0.2\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.2\build\netstandard2.0\NETStandard.Library.targets'))" />
+ <Error Condition="!Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets'))" />
</Target>
- <Import Project="..\packages\NETStandard.Library.2.0.2\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.2\build\netstandard2.0\NETStandard.Library.targets')" />
</Project> \ 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 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Discord.Net" version="1.0.2" targetFramework="net461" />
- <package id="Discord.Net.Commands" version="1.0.2" targetFramework="net461" />
- <package id="Discord.Net.Core" version="1.0.2" targetFramework="net461" />
- <package id="Discord.Net.Rest" version="1.0.2" targetFramework="net461" />
+ <package id="Discord.Net" version="2.0.0-beta" targetFramework="net461" />
+ <package id="Discord.Net.Commands" version="2.0.0-beta" targetFramework="net461" />
+ <package id="Discord.Net.Core" version="2.0.0-beta" targetFramework="net461" />
+ <package id="Discord.Net.Rest" version="2.0.0-beta" targetFramework="net461" />
<package id="Discord.Net.Rpc" version="1.0.2" targetFramework="net461" />
- <package id="Discord.Net.Webhook" version="1.0.2" targetFramework="net461" />
- <package id="Discord.Net.WebSocket" version="1.0.2" targetFramework="net461" />
- <package id="FSharp.Core" version="4.3.4" targetFramework="net461" />
- <package id="Microsoft.Extensions.DependencyInjection" version="2.0.0" targetFramework="net461" />
- <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.0.0" targetFramework="net461" />
- <package id="Microsoft.NETCore.Platforms" version="2.0.2" targetFramework="net461" />
+ <package id="Discord.Net.Webhook" version="2.0.0-beta" targetFramework="net461" />
+ <package id="Discord.Net.WebSocket" version="2.0.0-beta" targetFramework="net461" />
+ <package id="FSharp.Core" version="4.5.2" targetFramework="net461" />
+ <package id="Microsoft.Extensions.DependencyInjection" version="2.2.0-preview2-35157" targetFramework="net461" />
+ <package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="2.2.0-preview2-35157" targetFramework="net461" />
+ <package id="Microsoft.NETCore.Platforms" version="2.2.0-preview2-26905-02" targetFramework="net461" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="net461" />
- <package id="NETStandard.Library" version="2.0.2" targetFramework="net461" />
+ <package id="NETStandard.Library" version="2.0.3" targetFramework="net461" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
<package id="System.AppContext" version="4.3.0" targetFramework="net461" />
<package id="System.Collections" version="4.3.0" targetFramework="net461" />
<package id="System.Collections.Concurrent" version="4.3.0" targetFramework="net461" />
- <package id="System.Collections.Immutable" version="1.4.0" targetFramework="net461" />
+ <package id="System.Collections.Immutable" version="1.5.0" targetFramework="net461" />
<package id="System.ComponentModel" version="4.3.0" targetFramework="net461" />
<package id="System.Console" version="4.3.1" targetFramework="net461" />
<package id="System.Diagnostics.Debug" version="4.3.0" targetFramework="net461" />
- <package id="System.Diagnostics.DiagnosticSource" version="4.4.1" targetFramework="net461" />
+ <package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net461" />
<package id="System.Diagnostics.Tools" version="4.3.0" targetFramework="net461" />
<package id="System.Diagnostics.Tracing" version="4.3.0" targetFramework="net461" />
<package id="System.Globalization" version="4.3.0" targetFramework="net461" />
<package id="System.Globalization.Calendars" version="4.3.0" targetFramework="net461" />
- <package id="System.Interactive.Async" version="3.1.1" targetFramework="net461" />
+ <package id="System.Interactive.Async" version="3.2.0" targetFramework="net461" />
<package id="System.IO" version="4.3.0" targetFramework="net461" />
<package id="System.IO.Compression" version="4.3.0" targetFramework="net461" />
<package id="System.IO.Compression.ZipFile" version="4.3.0" targetFramework="net461" />
diff --git a/DiscoBot/session.json b/DiscoBot/session.json
index 03c46f3..d0c651d 100644
--- a/DiscoBot/session.json
+++ b/DiscoBot/session.json
@@ -6,69 +6,15 @@
"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,
"Ausdauer_Aktuell": 0,