Upgrade to discord.net 2.0-beta
This commit is contained in:
parent
948c48909e
commit
8cff234bc6
16 changed files with 32 additions and 12 deletions
|
@ -6,6 +6,7 @@ using Discord.Commands;
|
||||||
using Discord.WebSocket;
|
using Discord.WebSocket;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.UserRepository;
|
using Geekbot.net.Lib.UserRepository;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.UserRepository;
|
using Geekbot.net.Lib.UserRepository;
|
||||||
using OverwatchAPI;
|
using OverwatchAPI;
|
||||||
using OverwatchAPI.Config;
|
using OverwatchAPI.Config;
|
||||||
|
|
|
@ -5,6 +5,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using PokeAPI;
|
using PokeAPI;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands.Games
|
namespace Geekbot.net.Commands.Games
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.Converters;
|
using Geekbot.net.Lib.Converters;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using MtgApiManager.Lib.Service;
|
using MtgApiManager.Lib.Service;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands.Integrations
|
namespace Geekbot.net.Commands.Integrations
|
||||||
|
|
|
@ -6,6 +6,7 @@ using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.Clients;
|
using Geekbot.net.Lib.Clients;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands.Integrations
|
namespace Geekbot.net.Commands.Integrations
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,6 +6,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands.Integrations.UbranDictionary
|
namespace Geekbot.net.Commands.Integrations.UbranDictionary
|
||||||
|
|
|
@ -73,11 +73,9 @@ namespace Geekbot.net.Commands.Randomness
|
||||||
await ReplyAsync("", false, Eb(_mediaProvider.GetFox()));
|
await ReplyAsync("", false, Eb(_mediaProvider.GetFox()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private EmbedBuilder Eb(string image)
|
private Embed Eb(string image)
|
||||||
{
|
{
|
||||||
var eb = new EmbedBuilder();
|
return new EmbedBuilder {ImageUrl = image}.Build();
|
||||||
eb.ImageUrl = image;
|
|
||||||
return eb;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,6 +5,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Levels;
|
using Geekbot.net.Lib.Levels;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Localization;
|
using Geekbot.net.Lib.Localization;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ using Discord;
|
||||||
using Discord.Commands;
|
using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.Levels;
|
using Geekbot.net.Lib.Levels;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ using Discord.Commands;
|
||||||
using Discord.WebSocket;
|
using Discord.WebSocket;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
||||||
namespace Geekbot.net.Commands.Utils
|
namespace Geekbot.net.Commands.Utils
|
||||||
|
|
|
@ -8,6 +8,7 @@ using Discord.Commands;
|
||||||
using Geekbot.net.Lib;
|
using Geekbot.net.Lib;
|
||||||
using Geekbot.net.Lib.Converters;
|
using Geekbot.net.Lib.Converters;
|
||||||
using Geekbot.net.Lib.ErrorHandling;
|
using Geekbot.net.Lib.ErrorHandling;
|
||||||
|
using Geekbot.net.Lib.Extensions;
|
||||||
using Geekbot.net.Lib.UserRepository;
|
using Geekbot.net.Lib.UserRepository;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using StackExchange.Redis;
|
using StackExchange.Redis;
|
||||||
|
|
|
@ -189,12 +189,11 @@ namespace Geekbot.net.Commands.Utils.Quote
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var list = Context.Channel.GetMessagesAsync().Flatten();
|
var list = Context.Channel.GetMessagesAsync().Flatten();
|
||||||
await list;
|
return await list.FirstOrDefault(msg =>
|
||||||
return list.Result
|
msg.Author.Id == user.Id &&
|
||||||
.First(msg => msg.Author.Id == user.Id
|
msg.Embeds.Count == 0 &&
|
||||||
&& msg.Embeds.Count == 0
|
msg.Id != Context.Message.Id &&
|
||||||
&& msg.Id != Context.Message.Id
|
!msg.Content.ToLower().StartsWith("!"));
|
||||||
&& !msg.Content.ToLower().StartsWith("!"));
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="CommandLineParser" Version="2.2.1" />
|
<PackageReference Include="CommandLineParser" Version="2.2.1" />
|
||||||
<PackageReference Include="Discord.Net">
|
<PackageReference Include="Discord.Net">
|
||||||
<Version>1.0.2</Version>
|
<Version>2.0.0-beta</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.33.0.1202" />
|
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.33.0.1202" />
|
||||||
<PackageReference Include="HtmlAgilityPack" Version="1.8.1" />
|
<PackageReference Include="HtmlAgilityPack" Version="1.8.1" />
|
||||||
|
|
12
Geekbot.net/Lib/Extensions/EmbedBuilderExtensions.cs
Normal file
12
Geekbot.net/Lib/Extensions/EmbedBuilderExtensions.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using Discord;
|
||||||
|
|
||||||
|
namespace Geekbot.net.Lib.Extensions
|
||||||
|
{
|
||||||
|
public static class EmbedBuilderExtensions
|
||||||
|
{
|
||||||
|
public static EmbedBuilder AddInlineField(this EmbedBuilder builder, string name, object value)
|
||||||
|
{
|
||||||
|
return builder.AddField(new EmbedFieldBuilder().WithIsInline(true).WithName(name).WithValue(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ namespace Geekbot.net.Lib.Polyfills
|
||||||
public ulong Id { get; set; }
|
public ulong Id { get; set; }
|
||||||
public DateTimeOffset CreatedAt { get; set; }
|
public DateTimeOffset CreatedAt { get; set; }
|
||||||
public string Mention { get; set; }
|
public string Mention { get; set; }
|
||||||
public Game? Game { get; set; }
|
public IActivity Activity { get; }
|
||||||
public UserStatus Status { get; set; }
|
public UserStatus Status { get; set; }
|
||||||
public string AvatarId { get; set; }
|
public string AvatarId { get; set; }
|
||||||
public string Discriminator { get; set; }
|
public string Discriminator { get; set; }
|
||||||
|
|
Loading…
Reference in a new issue