mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 22:07:55 +00:00
Port more things!
This commit is contained in:
parent
f6fb8204bb
commit
47b16dc51b
26 changed files with 332 additions and 186 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue