Upgrade to discord.net 2.0-beta

This commit is contained in:
runebaas 2018-08-25 21:40:04 +02:00
parent 948c48909e
commit 8cff234bc6
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
16 changed files with 32 additions and 12 deletions

View file

@ -7,6 +7,7 @@ using Discord.Commands;
using Discord.WebSocket;
using Geekbot.net.Lib;
using Geekbot.net.Lib.ErrorHandling;
using Geekbot.net.Lib.Extensions;
using StackExchange.Redis;
namespace Geekbot.net.Commands.Utils

View file

@ -8,6 +8,7 @@ using Discord.Commands;
using Geekbot.net.Lib;
using Geekbot.net.Lib.Converters;
using Geekbot.net.Lib.ErrorHandling;
using Geekbot.net.Lib.Extensions;
using Geekbot.net.Lib.UserRepository;
using Newtonsoft.Json;
using StackExchange.Redis;

View file

@ -189,12 +189,11 @@ namespace Geekbot.net.Commands.Utils.Quote
try
{
var list = Context.Channel.GetMessagesAsync().Flatten();
await list;
return list.Result
.First(msg => msg.Author.Id == user.Id
&& msg.Embeds.Count == 0
&& msg.Id != Context.Message.Id
&& !msg.Content.ToLower().StartsWith("!"));
return await list.FirstOrDefault(msg =>
msg.Author.Id == user.Id &&
msg.Embeds.Count == 0 &&
msg.Id != Context.Message.Id &&
!msg.Content.ToLower().StartsWith("!"));
}
catch
{