mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 22:37:54 +00:00
implement proxied message and permcheck commands
This commit is contained in:
parent
2b304457cc
commit
e4f38c76a9
19 changed files with 233 additions and 155 deletions
|
|
@ -213,24 +213,4 @@ public static class ContextEntityArgumentsExt
|
|||
ctx.PopArgument();
|
||||
return channel;
|
||||
}
|
||||
|
||||
public static async Task<Guild> ParseGuild(this Context ctx, string input)
|
||||
{
|
||||
if (!ulong.TryParse(input, out var id))
|
||||
return null;
|
||||
|
||||
return await ctx.Rest.GetGuildOrNull(id);
|
||||
}
|
||||
|
||||
public static async Task<Guild> MatchGuild(this Context ctx)
|
||||
{
|
||||
if (!ulong.TryParse(ctx.PeekArgument(), out var id))
|
||||
return null;
|
||||
|
||||
var guild = await ctx.Rest.GetGuildOrNull(id);
|
||||
if (guild != null)
|
||||
ctx.PopArgument();
|
||||
|
||||
return guild;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue