mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
feat: implement system avatar commands
This commit is contained in:
parent
293570c91c
commit
b62340cbb3
11 changed files with 155 additions and 101 deletions
|
|
@ -10,6 +10,14 @@ namespace PluralKit.Bot;
|
|||
|
||||
public static class ContextEntityArgumentsExt
|
||||
{
|
||||
public static async Task<User> ParseUser(this Context ctx, string arg)
|
||||
{
|
||||
if (arg.TryParseMention(out var id))
|
||||
return await ctx.Cache.GetOrFetchUser(ctx.Rest, id);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static async Task<User> MatchUser(this Context ctx)
|
||||
{
|
||||
var text = ctx.PeekArgument();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue