Port more things!

This commit is contained in:
Ske
2020-12-24 14:52:44 +01:00
parent f6fb8204bb
commit 47b16dc51b
26 changed files with 332 additions and 186 deletions

View File

@@ -1,8 +1,6 @@
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.Entities;
using Myriad.Cache;
using Myriad.Types;
using PluralKit.Bot.Utils;
@@ -12,11 +10,12 @@ namespace PluralKit.Bot
{
public static class ContextEntityArgumentsExt
{
public static async Task<DiscordUser> MatchUser(this Context ctx)
public static async Task<User> MatchUser(this Context ctx)
{
var text = ctx.PeekArgument();
if (text.TryParseMention(out var id))
return await ctx.Shard.GetUser(id);
return await ctx.Cache.GetOrFetchUser(ctx.RestNew, id);
return null;
}